TABLE A TABLE B
EMPNO ENAME EMPNO ENAME
1 A 1 A
2 B 2 B
3 C 3 C
4 D 4 D
5 E 5 E
6 F
7 G
HOW TO GET THE UNMATCHED RECORDS IN SQL QUERY?
Answers were Sorted based on User's Feedback
Answer / sayalibsl
select e2.empno, e2.ename from A e1, B e2
where e1.empno!=e2.empno;
| Is This Answer Correct ? | 15 Yes | 5 No |
Answer / bijaylaxmi
select b.empno,b.ename from b where not exists(select * from a
where a.empno=b.empno)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / swastik
SELECT
e2.Empno, e2.Ename
FROM B e2
WHERE e2.Empno NOT IN
(
SELECT e1.Empno
FROM A e1
);
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / baji
select * from a full outer join b on a.empno=b.empno
minus
select * from a inner join b on a. empno=b.empno;
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / arun
select *from B where (empno,ename) not in (Select
empno,ename from A)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rajesh venati
select b.empno as empno, b.ename as ename from a, b where
a.empno!=b.empno;
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / shrawan kumar keshri
select * from A
except
select * from B
| Is This Answer Correct ? | 1 Yes | 3 No |
Which constraints we can use while creating database in sql?
What is anonymous block in sql?
How exception handling is done in advance pl/sql?
What are the parts of a sql statement?
What is oracle sql developer?
Why do we use sqlite?
I have a tablle like this. cust acc --------------- a 1 b 2|3 c 4|5|6 I Want below o/p: cust acc ----------- a 1 b 2 b 3 c 4 c 5 c 6 Please any one can you have any ideas share me. I have urgent requirement.
can i write pl/sql code in a package
What is difference between inner join and cross join?
How do you use join?
What are different sql data types?
How many types of primary keys are there?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)