Re: [sqlite] Group by without aggregates

2007-09-20 Thread Joe Wilson
> How does SQLite choose which row to return from a group?

http://www.mail-archive.com/sqlite-users@sqlite.org/msg17778.html



   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Group by without aggregates

2007-09-20 Thread Prakash Reddy Bande
Hi,

 

I have the following table:

 

CREATE TABLE users (SMD_cid varchar(50), uname varchar(50), version
integer);

 

select SMD_cid, uname, version from users;

2a946e78-0659-4746-aab7-6486ae9a26d3|auser|1

b0b520e9-54b3-224d-8183-09ef08501451|auser|1

9272f455-2c2a-7e4d-a140-c30fac34ab09|auser|0

66c6263d-e792-f94e-8f57-fd49c2e7b6a6|auser|0

 

select SMD_cid, uname, version from users group by version;

SMD_cid|uname|version

66c6263d-e792-f94e-8f57-fd49c2e7b6a6|auser|0

b0b520e9-54b3-224d-8183-09ef08501451|auser|1

 

I was excepting an error saying columns SMD_cid and uname are not
aggregate. But the query did give some results.

How does SQLite choose which row to return from a group?

 

Regards,

 

Prakash Reddy Bande

Altair Engg. Inc,

Troy, MI