Jump to content

SELECT DISTINCT problem


markw

Recommended Posts

Hello,

 

A DISTINCT seems to work on the whole row of results. Can it be limited to one field?

 

For example:

 

SELECT DISTINCT Email, count( tblusers.iID ) AS cnt, tblusers.iID, sFirstName, sLastName WHERE tblusers.iID = tbluseranswers.iUserID AND tbluseranswers.bCorrect = \'1\' GROUP BY tblusers.iID having cnt=4 ORDER BY tblusers.iID ASC

 

This will result in several rows with the same Email address. But i want only one result for all rows with the same Email address...

 

Does anyone have an idea?

 

Thanks,

 

Mark.

Link to comment
https://forums.phpfreaks.com/topic/723-select-distinct-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.