Subject | SELECT DISTINCT syntax |
---|---|
Author | Tim Ledgerwood |
Post date | 2004-06-29T08:36:33Z |
Hi,
What is the syntax for a select distinct query?
I have a table that contains shift information. I want a query that will
return me the shift number and shift date for shifts that contain valid
information.
SELECT DISTINCT(SHIFTNUM) FROM LOG WHERE (query parameters)
Works fine - it gives me the shifts that I want.
But
SELECT DISTINCT(SHIFTNUM, DBDATE) doesn't work.
Nor does
SELECT DISTINCT(SHIFTNUM), DBDATE
How can I solve this?
Regards
Tim
What is the syntax for a select distinct query?
I have a table that contains shift information. I want a query that will
return me the shift number and shift date for shifts that contain valid
information.
SELECT DISTINCT(SHIFTNUM) FROM LOG WHERE (query parameters)
Works fine - it gives me the shifts that I want.
But
SELECT DISTINCT(SHIFTNUM, DBDATE) doesn't work.
Nor does
SELECT DISTINCT(SHIFTNUM), DBDATE
How can I solve this?
Regards
Tim