SQL时间段的查询的两种执行方法
SELECT KS_Date, KS_MetalName, KS_TopLimit, KS_BottomLimit, KS_Average, KS_Change
FROM KS_U_SpotPrice
WHERE (KS_Date BETWEEN CONVERT(datetime, '2011-12-14') AND CONVERT(datetime, '2011-12-20'))
等效于下面的查询代码:
SELECT KS_Date, KS_MetalName, KS_TopLimit, KS_BottomLimit, KS_Average, KS_Change
FROM KS_U_SpotPrice
WHERE (KS_Date <= CONVERT(datetime, '2011 - 12 - 20')) AND (KS_Date >= CONVERT(datetime, '2011 - 12 - 14'))
微信号:jamesworkshop 学习QQ群:364976091