Link to home
Start Free TrialLog in
Avatar of Cheryl Lander
Cheryl LanderFlag for United States of America

asked on

select query troubles

I have a select query which works fine.

but I want toe exclude a result where catid = 126 How do I do this.

SELECT * FROM categories WHERE Parentid = 0 AND ORDER by catname
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America 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
mwvisa1 is correct, except you need to watch capitalization on the table name:

SELECT * FROM categories WHERE Parentid = 0 AND catid!=126 ORDER by catname
Depending on what database platform, the not equal may be != so the query would be:

CatId != 126.

If I am misunderstanding the exclude portion of the question you would just change this to be:

CatId = 126