Re: [sqlite] cast problems sqlite3

2007-03-12 Thread drh
Tom Shaw <[EMAIL PROTECTED]> wrote: > > Using sqlite 3.3.5 You really should try to use something more recent. > > UPDATE av_summary SET rank=((det*100.0)/(tot)); > > sets first row to an integer (serendipity?) and then all the other > rows are real or text which caused problems since I was

Re: [sqlite] cast problems sqlite3

2007-03-12 Thread Tom Shaw
At 1:40 PM + 3/12/07, [EMAIL PROTECTED] wrote: Tom Shaw <[EMAIL PROTECTED]> wrote: Here ya go. >Tom Shaw <[EMAIL PROTECTED]> wrote: >> UPDATE av_summary SET rank=((det*100.0)/(tot)); only sets the >> first row correctly then all the others have bogus data in rank > >That seems

Re: [sqlite] cast problems sqlite3

2007-03-12 Thread drh
Tom Shaw <[EMAIL PROTECTED]> wrote: > Here ya go. > > >Tom Shaw <[EMAIL PROTECTED]> wrote: > >> UPDATE av_summary SET rank=((det*100.0)/(tot)); only sets the > >> first row correctly then all the others have bogus data in rank > > > >That seems wrong. Can you post a sample database that

Re: [sqlite] cast problems sqlite3

2007-03-12 Thread drh
Tom Shaw <[EMAIL PROTECTED]> wrote: > UPDATE av_summary SET rank=((det*100.0)/(tot)); only sets the > first row correctly then all the others have bogus data in rank That seems wrong. Can you post a sample database that demonstrates this behavior? > [I]s there a "cast" operator in the

[sqlite] cast problems sqlite3

2007-03-12 Thread Tom Shaw
Help is appreciated. I have a table with integer columns rank, tot, det with values in tot and det and I want to put an integer percent (0-100) into rank UPDATE av_summary SET rank=(det/tot)*100; returns 0 I assume because the arithmetic is in integer UPDATE av_summary SET