I want to know how to work with inner joins in SQL Server.
Thank you.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vilas GitePosted Jul 3, 2012, 8:39 AM
Vilas GitePosted Jul 3, 2012, 8:37 AM
Satyapriya NayakPosted Jul 2, 2012, 8:57 AM
SQL INNER JOIN
The INNER JOIN keyword return rows when there is at least one match in both tables.
SQL INNER JOIN Syntax
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
PS: INNER JOIN is the same as JOIN.
SQL INNER JOIN Example
The "Persons" table:
The "Orders" table:
Now we want to list all the persons with any orders.
We use the following SELECT statement:
FROM Persons
INNER JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName
The result-set will look like this:
The INNER JOIN keyword return rows when there is at least one match in both tables. If there are rows in "Persons" that do not have matches in "Orders", those rows will NOT be listed.
Please refer the below link
http://www.w3schools.com/sql/sql_join_inner.asp
Thanks
Kunal VaishyaPosted Jul 2, 2012, 6:54 AM
is work like this