SQL Server - inner join - Asked By noor almumaz on 01-Oct-11 11:41 AM

Hi!

if there is atable which are alrady created and in the table there is inner join which asql comman should I use to view this inner join
Kirtan Patel replied to noor almumaz on 01-Oct-11 11:51 AM
Inner join is used in Query it can not be seen without looking at query .. 

you can may be view what type of constraints are applied to tables 

EXEC sp_help TABLENAME
Reena Jain replied to noor almumaz on 01-Oct-11 12:45 PM
Hi,

we apply join on table using query. you can create view using join and you can see the join for view. but on table you can not view join. Table having the data for dml operation.
noor almumaz replied to Reena Jain on 01-Oct-11 12:49 PM
Thankx alot for you answer
Neha Garg replied to noor almumaz on 01-Oct-11 02:32 PM

The INNER JOIN keyword return rows when there is at least one match in both tables.

SQL INNER JOIN Syntax

SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name

Basically to get the record from two tables using the common field from the tables....
Neha Garg replied to noor almumaz on 01-Oct-11 02:33 PM

The INNER JOIN keyword return rows when there is at least one match in both tables.

SQL INNER JOIN Syntax


SELECT column_name(s)

FROM table_name1

INNER JOIN table_name2

ON table_name1.column_name=table_name2.column_name
Suchit shah replied to noor almumaz on 01-Oct-11 11:07 PM

Inner JOIN

INNER_JOIN.png

This is the simplest, most understood Join and is the most common. This query will return all of the records in the left table (table A) that have a matching record in the right table (table B). This Join is written as follows:

SELECT <select_list> 
FROM Table_A A
INNER JOIN Table_B B
ON A.Key = B.Key

Suchit shah replied to noor almumaz on 01-Oct-11 11:08 PM
If u want to more refer about the joins please refer
http://www.codeproject.com/KB/database/Visual_SQL_Joins.aspx
Radhika roy replied to noor almumaz on 02-Oct-11 05:34 AM
An inner join is a join in which the values in the columns being joined 
are compared using a comparison operator.
Example-

SELECT * FROM Individual
INNER JOIN Publisher
ON Individual.IndividualId = Publisher.IndividualId
WHERE Individual.IndividualId = '2'

Source Tables


Left Table

Id FirstName LastName UserName
1 Fred Flinstone freddo
2 Homer Simpson homey
3 Homer Brown notsofamous
4 Ozzy Ozzbourne sabbath
5 Homer Gain noplacelike


Right Table

IndividualId AccessLevel
1 Administrator
2 Contributor
3 Contributor
4 Contributor
10 Administrator


Result

IndividualId FirstName LastName UserName IndividualId AccessLevel
2 Homer Simpson homey 2 Contributor