日期:2014-05-17 浏览次数:20438 次
USE test
GO
-->生成表tb
if object_id('tb') is not null
drop table tb
Go
Create table tb([id] smallint,[name] nvarchar(4),[type] smallint)
Insert into tb
Select 1,N'水果',1
Union all Select 2,N'苹果',1
Union all Select 3,N'香蕉',1
Union all Select 4,N'玩具',4
Union all Select 5,N'泰迪熊',4
Union all Select 6,N'变形金刚',4
Union all Select 7,N'流氓兔',4
--------------- 1.
SELECT
b.id AS [唯一编号]
,b.name AS [名称]