Re: [sqlite] how to write this commands?

2014-05-15 Thread Paul
> update adla1 set PFLOPF=(SELECT pflopf from adl where adla1.ref=adl.ref) > where select count(adl.ref) from adl=1; A bit optimized version... UPDATE adla1 SET pflopf = (SELECT pflopf FROM adl WHERE adl.ref = adla1.ref) WHERE (SELECT COUNT(*) FROM (SELECT 1 FROM adl WHERE adl.ref =

Re: [sqlite] how to write this commands?

2014-05-15 Thread Igor Tandetnik
On 5/15/2014 6:03 AM, YAN HONG YE wrote: update adla1 set PFLOPF=(SELECT pflopf from adl where adla1.ref=adl.ref) where select count(adl.ref) from adl=1; Are you looking for something like this? update adla1 set PFLOPF=( select case count(*)=1 then max(adl.pflopf) else adla1.pflopf end

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Drago, William @ MWG - NARDAEAST
I'm willing to bet that the problem is in your C# code. The variable receiving the INTEGER column is probably declared as an INT instead of LONG or ULONG. -Bill > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Werner

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin
On 15 May 2014, at 12:53pm, Werner Kleiner wrote: > What we use is this: > > System.Data.SQLite > System.Data.SQLite Download Page > > http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki > > And this is not part of SQLite? Not really. As the page says

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
What we use is this: System.Data.SQLite System.Data.SQLite Download Page http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki And this is not part of SQLite? -- View this message in context:

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin
On 15 May 2014, at 12:08pm, Werner Kleiner wrote: > Simon Slavin-3 wrote >> There is no need to do anything special. f you use 'Int' in SQLite it >> will be interpreted as 'INTEGER' anyway. > > Yes, but back to my datareader problem it seems that the Datareader differs >

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
Simon Slavin-3 wrote > There is no need to do anything special. f you use 'Int' in SQLite it > will be interpreted as 'INTEGER' anyway. Yes, but back to my datareader problem it seems that the Datareader differs between a column which is 'INTEGER' or 'Int'. Especially we had a problem with a

Re: [sqlite] Help on forming the correct aggregation statement with a Union clause

2014-05-15 Thread E.Pasma
Op 15 mei 2014, om 12:09 heeft E.Pasma het volgende geschreven: Op 14 mei 2014, om 21:44 heeft Wendy het volgende geschreven: Hi, Wondering if anyone can help me with the following: - Does anyone know how I can get the SUM() aggregate function within this SQLite statement? SELECT

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Simon Slavin
On 15 May 2014, at 7:22am, Werner Kleiner wrote: > What I mean is: The original MySQL DB has columns with int(10). And the > converting tool converts all these columns in SQLite to Int > I can change the conversion so that all columns would be INTEGER in SQLite. > As I

Re: [sqlite] Help on forming the correct aggregation statement with a Union clause

2014-05-15 Thread E.Pasma
Op 14 mei 2014, om 21:44 heeft Wendy het volgende geschreven: Hi, Wondering if anyone can help me with the following: - Does anyone know how I can get the SUM() aggregate function within this SQLite statement? SELECT AwayTeam As 'Team', CASE WHEN AwayTeamScore > HomeTeamScore

[sqlite] how to write this commands?

2014-05-15 Thread YAN HONG YE
update adla1 set PFLOPF=(SELECT pflopf from adl where adla1.ref=adl.ref) where select count(adl.ref) from adl=1; ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Help on forming the correct aggregation statement with a Union clause

2014-05-15 Thread Wendy
Hi, Wondering if anyone can help me with the following: - Does anyone know how I can get the SUM() aggregate function within this SQLite statement? SELECT AwayTeam As 'Team', CASE WHEN AwayTeamScore > HomeTeamScore THEN 3 WHEN AwayTeamScore=HomeTeamScore THEN 1 ELSE 0 END AS

Re: [sqlite] Using SQLite's VFS in C++

2014-05-15 Thread Ralf
Thanks for this tip, this could possibly work! On 05/14/2014 06:18 AM, J Decker wrote: > the name that gets passed is the one you pass to sqlite_open... so just use > that as an indicator of which object to use and in the open callback, > result with the appropriate object... or don't use the

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Richard Hipp
On Thu, May 15, 2014 at 3:23 AM, Stephen Chrzanowski wrote: > Technically, SQLite thinks STRING = INTEGER as far as field definitions are > concerned, but either int or integer will do the job. > Not so. Please see http://www.sqlite.org/datatype3.html#affinity SQLite

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread RSmith
Integer and Int is equivalent in SQLite indeed, except in primary keys - where if you declare a primary key as INTEGER PRIMARY KEY it becomes an alias for the rowid, and INT PRIMARY KEY is a normal Integer primary key but distinct from the rowid. In all other cases they mean the same. On

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Stephen Chrzanowski
Technically, SQLite thinks STRING = INTEGER as far as field definitions are concerned, but either int or integer will do the job. On Thu, May 15, 2014 at 2:22 AM, Werner Kleiner wrote: > What I mean is: The original MySQL DB has columns with int(10). And the > converting

Re: [sqlite] SQLite Datareader problems with Int?

2014-05-15 Thread Werner Kleiner
What I mean is: The original MySQL DB has columns with int(10). And the converting tool converts all these columns in SQLite to Int I can change the conversion so that all columns would be INTEGER in SQLite. As I understand for SQLite it is equal if the column is declared as Int or INTEGER? --