Sid Sid - 1 year ago 74
MySQL Question

How to exclude particular row id from query results?

I have a table of Member, in that I have three rows which has

s as
. Now, I want to select all members from the table excluding these three

For this, I tried the following query:

SELECT * FROM `Member`
WHERE Member.member_id NOT IN (
SELECT member_id
FROM Member
WHERE Member.member_id = 'manager'
AND Member.member_id = 'admins'
AND Member.member_id = 'admin'

But still I can see those three rows selected in the result.

How can I do this?

Answer Source

You need to write query like below :

SELECT * FROM `Member` WHERE Member.member_id NOT IN ('admins' , 'admin','manager');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download