日期:2014-05-17 浏览次数:20672 次
--> 测试数据:@T
declare @T table([TM] datetime,[DK] bit)
insert @T
select '2013-02-01',0 union all
select '2013-01-29',1 union all
select '2013-07-12',0 union all
select '2013-02-04',1 union all
select '2013-02-01',1
select * from @T ORDER BY [TM] DESC,[DK]
--利用 RecordSet 将 bit 字段中的数据取出来后,它是 boolean 类型0(false)或1(true).
/*
TM DK
----------------------- -----
2013-07-12 00:00:00.000 0
2013-02-04 00:00:00.000 1
2013-02-01 00:00:00.000 0
2013-02-01 00:00:00.000 1
2013-01-29 00:00:00.000 1
*/