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'))



学习交流群:364976091
上一篇:Angular 项目里 angular.json 文件内容的学习笔记


下一篇:java中自动生成XML文件