Re: [SQL] select distinct and order by

2004-04-28 Thread Stijn Vanroye
he help, Stijn Vanroye -Original Message- From: Viorel Dragomir [mailto:[EMAIL PROTECTED] Sent: woensdag 28 april 2004 11:54 To: Stijn Vanroye; [EMAIL PROTECTED] Subject: Re: [SQL] select distinct and order by I don't know if this will work, but why not try it ? :) select distinc

Re: [SQL] select distinct and order by

2004-04-28 Thread Viorel Dragomir
I don't know if this will work, but why not try it ? :)   select distinct fullname, distinct staff_id, loginname from staffwhere staff_id in   (select staff_id from staffmembership where staffgroup_id=#SomeIdValue#)order by fullname, staff_id     Next one is more complicate but with more chan

Re: [SQL] Select distinct and order by.

2001-07-17 Thread Tom Lane
Carlos <[EMAIL PROTECTED]> writes: > Select distinct field1, field2 from table1 order by field3; > The value return by PQresultErrorMessage is: > For SELECT DISTINCT, ORDER BY expressions must appear in target list > Whatever this query works fine in postgresql 6.5.3. > Is correct this query a

Re: [SQL] Select distinct and order by.

2001-07-17 Thread Tod McQuillin
On Wed, 11 Jul 2001, Carlos wrote: > Select distinct field1, field2 from table1 order by field3; > > The value return by PQresultErrorMessage is: > > For SELECT DISTINCT, ORDER BY expressions must appear in target list That's because this query is ambiguous. What if table1 looks like this: fie