[SOLVED] Using DISTINCT function..
Posted: Mon Mar 01, 2004 6:38 am
Hi guys..hows going. Just need some help in mysql syntax.
I need to select two fields (field1 and field2) in table "mytable" and A have to be distinct.
So i wrote,
SELECT DISTINCT field1, field2 FROM mytable ORDER BY field1
and all it does is selecting all field1, field2 including duplicates. I did some reseach online but no luck. Can any SQL gurus help me..Please...Thank you
I need to select two fields (field1 and field2) in table "mytable" and A have to be distinct.
So i wrote,
SELECT DISTINCT field1, field2 FROM mytable ORDER BY field1
and all it does is selecting all field1, field2 including duplicates. I did some reseach online but no luck. Can any SQL gurus help me..Please...Thank you