difficulty with distinct parameter
Posted: Sun Mar 01, 2009 5:12 pm
I have the following bit of code:
and the result set are 4 when I had hoped it would be just 1.
There are 4 records with the same request_uri but I only want returned 1 instance of that. In the above code the id's are all different and I'm sure that is why 4 rows are returned and not 1.
What would I do to make sure only the first occurrence of the request_uri is returned along with those other fields?
Much confused.
Thanks in advance.
Code: Select all
SELECT distinct request_uri , sent_or_not_sent, id FROM web3_access_log where sent_or_not_sent = '0'There are 4 records with the same request_uri but I only want returned 1 instance of that. In the above code the id's are all different and I'm sure that is why 4 rows are returned and not 1.
What would I do to make sure only the first occurrence of the request_uri is returned along with those other fields?
Much confused.
Thanks in advance.