Re: [sqlite] find the highest rank per group

2008-01-28 Thread P Kishor
On 1/28/08, Fowler, Jeff <[EMAIL PROTECTED]> wrote: > Puneet, > > I'm assuming you meant to say "where rank is the highest" rather than > title, as that's what your example shows. indeed. > > Here's the syntax: > select * from table a > where rank = (select max(rank) from table b where b.id = a.i

RE: [sqlite] find the highest rank per group

2008-01-28 Thread Fowler, Jeff
Puneet, I'm assuming you meant to say "where rank is the highest" rather than title, as that's what your example shows. Here's the syntax: select * from table a where rank = (select max(rank) from table b where b.id = a.id) - Jeff -Original Message- From: P Kishor [mailto:[EMAIL PROTECT

Re: [sqlite] find the highest rank per group

2008-01-28 Thread Alexander Batyrshin
Try to use "GROUP by name". On Jan 29, 2008 4:42 AM, P Kishor <[EMAIL PROTECTED]> wrote: > I have > > id, name, .., title, rank > 1, a, .., foo, 5 > 1, a, .., bar, 4 > 1, a, .., bar, 7 > 2, b, .., baz, 6 > 2, b, .., qux, 9 > > and so on > > I want > > 1, a, .., bar, 7 > 2, b, .., qux, 9 > > that i