Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to use join in sql
How to use join in sql
Posted
Updated 3-Apr-19 19:44pm
Comments
member60 18-May-12 1:02am    
Don't limit your query with this much, dig into more and try to learn more, these are the simple concepts no? better to to learn joins , different type of joins in sql and many basic thing.
Surf through google you will find every answer there , and our CP experts are always ready to help learners. hope you are agree with this.

 
Share this answer
 
Comments
Wendelius 18-May-12 1:07am    
Good links! We added some links at the same time :)
Maciej Los 18-May-12 6:39am    
Thank you ;)
Prasad_Kulkarni 18-May-12 1:12am    
sqlteam is my favorite one. Good answer Isomac! +5!
Maciej Los 18-May-12 6:39am    
Thank you ;)
VJ Reddy 18-May-12 1:44am    
Good references. 5!
One quite good tutorial is found at SQL Joins[^]
 
Share this answer
 
Comments
Prasad_Kulkarni 18-May-12 1:14am    
w3schools always useful, My 5!
Wendelius 18-May-12 1:26am    
True :)
VJ Reddy 18-May-12 1:44am    
Good reference. 5!
Wendelius 18-May-12 13:14pm    
Thanks :)
Maciej Los 18-May-12 6:40am    
... the same time... and the same site ;) +5
SQL
select * from table1 e join table2 e1 on e.id=e1.id


There should be a common field in both tables.
 
Share this answer
 
v2
Comments
member60 23-May-12 5:16am    
my 5 !
sharmarun 29-May-12 6:17am    
my 5!
MAKReddy 29-Jun-12 1:36am    
my 5!
 
Share this answer
 
this may also help you to find the difference between them,
Differences Between Various Joins in MS SQL Server[^]
 
Share this answer
 
There are certain types of joins, such as Inner join, outer join, Left outer join, Right Outer join, Cross Join.

Here, we will see the inner join.
If you want to have the common data from two tables then inner join is used.The query of inner join will be as follows:

Select * from Table1 Inner Join Table2 ON Table1.id = Table2.id;
 
Share this answer
 
Comments
CHill60 4-Apr-19 4:11am    
You have added nothing at all to the solutions that were posted 7 years ago. Try to make sure you are brining something new to the thread, especially old ones like this

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