日期:2014-05-16 浏览次数:20454 次
IF EXISTS(SELECT NAME FROM sys.objects AS o WHERE NAME = 't1')
DROP TABLE t1
GO
CREATE TABLE t1(id VARCHAR(03) , custnm NVARCHAR(10) , qty INT , amt INT , [date] DATE)
GO
INSERT INTO t1
SELECT '001' , N'杭州' , 1 , 10 , '2014-01-05' UNION ALL
SELECT '001' , N'杭州' , 2 , 14 , '2014-01-05' UNION ALL
SELECT '002' , N'上海' , 1 , 3 , '2014-01-05'
GO
IF EXISTS(SELECT NAME FROM sys.objects AS o WHERE NAME = 't2')
DROP TABLE t2
GO
CREATE TABLE t2(diqu NVARCHAR(4) ,&