first table result for first table values not equal with second table [Resolved]

Posted by Rajesh081725 under Sql Server on 12/10/2012 | Points: 10 | Views : 603 | Status : [Member] | Replies : 4
Can u any one tell me

i have used two table

i want expected first table result for first table values not equal with second table

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.



Responses

Posted by: Rajesh081725 on: 12/10/2012 [Member] Bronze | Points: 25

Up
0
Down

Resolved
Hi Pavan,

This is Result

Select a.empno from emp a Left Join emp1 b ON a.empno=b.empno Where b.empno Is Null

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/10/2012 [Member] Bronze | Points: 25

Up
0
Down
Table1
Empid Empname
1 Ram
2 Subash
3 Tanvik


Table2
Empid Empname
1 Kishore
2 Subash
3 Tanvik

select Table1.Empid,Table1.Empname from Table1,Table2 where
Table1.Empid != Table2.Empid and
Table1.Empname != Table2.Empname

mark the answer if this helps

Thanks
Pavan Kumar
Mark Answer if this fits the need

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh081725 on: 12/10/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Pavan,

i have use to check join condition empid only

and without use not in and sub query

do u know any join conition for this query.

Empid Empname
1 Ram
2 Subash
3 Tanvik


Table2
Empid Empname
1 Kishore
2 Subash
3 Tanvik

Result:

Ram

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/10/2012 [Member] Bronze | Points: 25

Up
0
Down
ok then try this

select Table1.Empid,Table1.empname from Table1 left join Table2 on table1.empid = table2.empid where Table2.empid is null

mark the answer if this helps you

Thanks
Pavan Kumar
Mark Answer if this fits the need

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response