Select only unique rows in mysql?

How is this SELECT T. Id,T. Name,T.

Userid FROM tbltest T GROUP BY T. Userid HAVING COUNT(T. Userid) = 1.

– Greg Mar 11 '09 at 21:38 Probably not, but all I did was add the GROUP BY and HAVING to the statement he posted. – Hawk Kroeger Mar 11 '09 at 21:40 I don't think this will work. Not a MySQL user, but doesn't GROUP BY have to list all columns that aren't aggregated?

Most RDBMSs do... – Ken White Mar 11 '09 at 21:47.

Try SELECT T. Id, T. Name, T.

Userid, count(*) AS count FROM tbltest GROUP BY T. Userid HAVING count = 1.

I don't think that's the fastest way... you could try: SELECT T. Id, T. Name, T.

Userid, COUNT(*) AS num FROM tbltest T GROUP BY T. Userid HAVING num = 1 Or SELECT T. Id, T.Name, T.

Userid, COUNT(*) AS num FROM tbltest T WHERE NOT EXISTS (SELECT 1 FROM tbltest T2 WHERE T2. Userid = T. Userid AND T2.

Id! = T.Id).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions