标签:
首先看看Left Join 与Right Join 与 Inner Join 与 Full Join对表进行操作后得到的结果。
新建表:
USE [Test]
GO
/****** 对象: Table [dbo].[EMP] 脚本日期: 06/22/2012 15:37:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EMP](
[ENAME] [nchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL,
[CITY] [nchar](10) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
/****** 对象: Table [dbo].[SAL] 脚本日期: 06/22/2012 15:38:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SAL](
[ENAME] [nchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL,
[SALARY] [money] NULL
) ON [PRIMARY]
插入数据得到的表:
EMP表:
SAL表:
SQL中Left Join 与Right Join 与 Inner Join 与 Full Join的区别
标签:
原文地址:http://www.cnblogs.com/hushzhang/p/5646398.html