Friday 6 September 2013

Different types of joins in SQLSERVER

--------------------------Different types of joins-----------------------

1.FULL OUTER JOIN

SELECT * FROM [table name1] T1 FULL OUTER JOIN [table name2] T2 ON 
           T1.[column name]=T2.[column name]


DECLARE @id INT
SELECT * FROM [table name] WHERE [column name]=@id  
                 OR [column name] IS NULL

No comments:

Post a Comment

EMP, DEPT Sample script

/****** Object:  Table [dbo].[DEPT]    Script Date: 19-05-2016 06:58:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET A...