Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

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

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

Answer / b

select * from B
minus
select * from A;

Is This Answer Correct ?    12 Yes 3 No

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

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

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

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

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

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

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

Answer / raj kumar

selecet empno,ename from table a
minus
select empno,ename from table b

Is This Answer Correct ?    1 Yes 1 No

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

Answer / damy

select * from b where b.empno not in(select a.empno from a);

Is This Answer Correct ?    1 Yes 1 No

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

Answer / arun

select *from B where (empno,ename) not in (Select
empno,ename from A)

Is This Answer Correct ?    0 Yes 0 No

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

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

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A ..

Answer / shrawan kumar keshri

select * from A
except
select * from B

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

How do you explain an index number?

0 Answers  


What is the difference between between and in condition operators?

0 Answers  


What is serial sql?

0 Answers  


what is the difference between where clause and having clause? : Sql dba

0 Answers  


Explain what is sql?

0 Answers  


Hi Guys, I have a situation where I need to access the column values from rowtype variable. However, the column names are dynamic. below is sample code: declare Cursor c1 is select * from emp; Cursor c2 is select column_name from xyztable; v_c2 c2%rowtype; v_str varchar2 v_value varchar2(200); begin for rec in c1 loop open c2;---this cursor has column names like EMPLOYEE_ID, FIRST_NAME, LAST_NAME etc. loop fetch c2 into v_c2; exit when c2%notfound; /* now lets say i want to access value of LAST_NAME from cursor c1, so I am writing below code, however it does not work as expected */ v_str:= 'rec.'|| v_c2.column_name; -- this will give me string like "rec.EMPLOYEE_ID" v_value:=v_str; end loop; end loop; end; / Plz help ASAP.Thanks.

2 Answers  


What is scalar and vector?

0 Answers  


What is the difference between distinct and unique in sql?

0 Answers  


What is foreign key and example?

0 Answers  


sales persons should always receive commission of 100 at least. employees who r not sales persons should never receive commission.(Triggers)

1 Answers   Fidelity, Oracle,


If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE?

4 Answers  


Why should I use postgresql?

0 Answers  


Categories