Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 join query

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-05-20 : 02:08:15
I have 3 tables a,b,c
smaple data:

table A:

ID, Fname, Lanme dob
1 aaa b 10/10/1990
2 bbb c 14/02/1989
3 ccc d 19/11/1986



table B:

ID position function salary
1 trainee it 5000
2 contract hr 4500
3 permannent product 6000


table c

positionid position isappriaser
1 trainee 1
2 contract 0
3 permanent 1


Now i want the result like:
(only want to display the name and postion of isappraiser=1)

ID fname laname position
1 aaa b trainee
3 ccc d permanent


how to do with sqlserver 2008 ?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-05-20 : 02:15:35
[code]
select *
from tablea a
inner join tableb on a.id = b.id
inner join tablec on b.position = c.position
where c.isappraiser = 1
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amityadav84
Starting Member

1 Post

Posted - 2010-05-20 : 12:30:47
what is diffrence between inner join and equi join

yadav
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-20 : 14:01:41
http://www.orafaq.com/wiki/Equi_join


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -