Link to home
Start Free TrialLog in
Avatar of LCNANCY
LCNANCY

asked on

DISTINCT MYSQL QUERY

SELECT DISTINCT serv_nam, serv_lab  FROM ANI_SIT_ARC WHERE serv_nam != \"\" ORDER BY id

Doesnt work, do U see why ?
Thank you
Avatar of gavsmith
gavsmith
Flag of United Kingdom of Great Britain and Northern Ireland image

Not equal to in SQL is written as <> not !=
Hi there,

assuming you want to select non empty values try this.


-TheDoctor
SELECT DISTINCT serv_nam, serv_lab  FROM ANI_SIT_ARC WHERE serv_nam IS NOT NULL AND serv_nam <> '' ORDER BY id

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LCNANCY
LCNANCY

ASKER

no