Hi there,
I am new to sql and below is my table structure-
cid name
1 A
2 A
2 B
3 A
3 B
3 C
4 A
5 A
5 C
6 A
I want only those records where name is A or C and not B
I mean the output will be -
cid name
1 A
4 A
5 A
5 C
6 A
thanks in adv
John
Hi there,
I am new to sql and below is my table structure-
cid name
1 A
2 A
2 B
3 A
3 B
3 C
4 A
5 A
5 C
6 A
I want only those records where name is A or C and not B
I mean the output will be -
cid name
1 A
4 A
5 A
5 C
6 A
thanks in adv
John
Last edited by johnbest; 12-06-2013 at 02:02 AM. Reason: output
Try:
SELECT * FROM tablename WHERE cid Not In (SELECT cid FROM tablename WHERE [name] = "B");
Review this thread with similar requirement https://www.accessforums.net/queries...ues-39846.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.