Reputation: 11
I want to retrieve all the records from mem_info except the records whose username is 'qq';
following is my query
select * from mem_info where hashtag like '%love%'
EXCEPT select * from mem_info where username='qq';
Thanks in advance.
Upvotes: 1
Views: 699
Reputation: 11556
Query
SELECT * FROM mem_info
WHERE hashtag LIKE '%love%'
AND username NOT IN ('qq');
Upvotes: 0
Reputation: 172458
Try this:
select * from mem_info where hashtag like '%love%' and username <>'qq';
Upvotes: 2