Jump to content


Photo

SELECT DISTINCT problem


  • Please log in to reply
1 reply to this topic

#1 markw

markw
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 15 July 2003 - 11:01 PM

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.

#2 rhysmeister

rhysmeister
  • Members
  • PipPipPip
  • Advanced Member
  • 51 posts
  • LocationEngland

Posted 16 July 2003 - 11:16 AM

Try this

SELECT DISTINCTROW




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users