日期:2014-05-17 浏览次数:20456 次
CREATE TABLE temp1(fID [varchar](150) not NULL,
[fdate] smalldatEtime not NULL,
[fvalue] [decimal](8, 2) NULL
)
INSERT TEMP1
SELECT 1, GETDATE(), 0 UNION ALL
SELECT 2, GETDATE()+2, 0 UNION ALL
SELECT 3, GETDATE()+3, 0 UNION ALL
SELECT 4, GETDATE()+4, 0 UNION ALL
SELECT 5, GETDATE()+5, 0 UNION ALL
SELECT 6, GETDATE()+6, 0 UNION ALL
SELECT 7, GETDATE()+7, 0 UNION ALL
SELECT 8, GETDATE()+8, 0 UNION ALL
SELECT 9, GETDATE()+9, 0 UNION ALL
SELECT 10, GETDATE()+10, 0
SELECT TOP(10)PERCENT*
FROM TEMP1
ORDER BY fdate
/*
fID fdate fvalue
1 2013-08-11 15:18:00 0.00
*/