Forums
This topic is locked
ordering distinct fields???
Posted 10 Jun 2002 13:45:06
1
has voted
10 Jun 2002 13:45:06 Andy Smith posted:
Has anyone any idea how to order distinct fields?I have currently:
SELECT distinct dy
FROM hit_counter
What I would like is:
SELECT distinct dy
FROM hit_counter
ORDER BY id
Currently it displays the fields by hits but I would like to play around with displaying the fields in different ways and this is really starting to grate on my fragile nerves.
Replies
Replied 10 Jun 2002 15:51:58
10 Jun 2002 15:51:58 Julio Taylor replied:
What exactly do you want to do and what is the problem/error you're getting?
-- Julio
-- Julio
Replied 10 Jun 2002 16:04:14
10 Jun 2002 16:04:14 Andy Smith replied:
I want to display the hits by day such as 5th July but the 10th appears first. Because the hits are updated day by day I want to order by id (therefore be in the right order).
I could use datestamp, but I want people to be able to see the hits on any day by dropdown, so in the future they can see the hits on say 5/6/2002 by selecting 5, 6, and 02.
I also need to order fields on other pages where distinct fields are lso used.
The error I get is
'[Microsoft][ODBC Microsoft Access Driver] ORDER BY clause (id) conflicts with DISTINCT'
Hope may explanation is not too confusing!
I could use datestamp, but I want people to be able to see the hits on any day by dropdown, so in the future they can see the hits on say 5/6/2002 by selecting 5, 6, and 02.
I also need to order fields on other pages where distinct fields are lso used.
The error I get is
'[Microsoft][ODBC Microsoft Access Driver] ORDER BY clause (id) conflicts with DISTINCT'
Hope may explanation is not too confusing!