Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, a got a few question. I know that using 1 table i could call all its column
EXAMPLE:
"Select * from [tbl1]"

but ive got a problem
what if ive got a lot of table and they are in a relationship. The unique identifier for the is [1] cause all of table have [1] and i think it is their primary key

is there any tutorial where i can call all of them using a sigle query?
or could you provide me the query string?

by the way im using SQLServer 2005

Thanks in advance and more power..
Posted

You can use JOIN to do this kind of task. There are actually a lot of tutorials if you just search in google. Some of them are below

SQL Joins[^]
SQL Join Tutorial[^]
SQL Join[^]
 
Share this answer
 
Comments
janwel 29-Apr-11 1:55am    
thanks
You can use INNER JOIN

SQL
Select T1.*,T2.* from [tbl1] T1 INNER JOIN [tbl2] T2 ON T1.ID = T2.ID


Thanks,
Imdadhusen
 
Share this answer
 
Comments
janwel 29-Apr-11 1:55am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900