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
 General SQL Server Forums
 New to SQL Server Programming
 How to add a table name without joining

Author  Topic 

kalyan.cse05
Yak Posting Veteran

74 Posts

Posted - 2012-05-08 : 05:55:14
I have a query which contains 3 tables. but i want to add two table using inner join and also want to add the 3rd table.

E.G:

select A.a,B.b,C.c
from A
inner join B on A.a=B.b
where
C.c=1
[Here C is the 3rd table which doesn't have any matching column with A or B table.]
So can anyone tell me how i can add the table name C in the query.


kalyan Ashis Dey

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-08 : 06:15:03
[code]
from A
inner join B on A.a = B.b
inner join C on C.c = 1
[/code]


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

Go to Top of Page

kalyan.cse05
Yak Posting Veteran

74 Posts

Posted - 2012-05-08 : 06:22:03
Thanks a lot

kalyan Ashis Dey
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-08 : 11:21:42
quote:
Originally posted by kalyan.cse05

Thanks a lot

kalyan Ashis Dey


thats as good as cross join with where condition C.c=1


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -