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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal VaishyaRank #990 · 2K reputationPosted Jul 2, 2012, 2:54 AM EDT
is work like this
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 2, 2012, 4:57 AM EDT
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
Vilas GiteRank #951 · 2.1K reputationPosted Jul 3, 2012, 4:37 AM EDT
Vilas GiteRank #951 · 2.1K reputationPosted Jul 3, 2012, 4:39 AM EDT