{"id":472,"date":"2009-06-20T13:47:00","date_gmt":"2009-06-20T05:47:00","guid":{"rendered":""},"modified":"2013-11-27T20:38:50","modified_gmt":"2013-11-27T12:38:50","slug":"sql%e6%97%a5%e6%9c%9f%e8%8e%b7%e5%8f%96","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/472.html","title":{"rendered":"SQL\u65e5\u671f\u83b7\u53d6"},"content":{"rendered":"<p>\u5f53\u524d\u65e5\u671f<br \/>\nselect CONVERT(varchar(10), getdate(), 120)<\/p>\n<p>\u4e00\u4e2a\u6708\u7b2c\u4e00\u5929\u7684SQL \u811a\u672c\uff1a<br \/>\nSELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)<\/p>\n<p>\u672c\u5468\u7684\u661f\u671f\u4e00<br \/>\nSELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)<\/p>\n<p>\u4e00\u5e74\u7684\u7b2c\u4e00\u5929<br \/>\nSELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)<\/p>\n<p>\u5b63\u5ea6\u7684\u7b2c\u4e00\u5929<br \/>\nSELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)<\/p>\n<p>\u5f53\u5929\u7684\u534a\u591c<br \/>\nSELECT DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)<\/p>\n<p>\u4e0a\u4e2a\u6708\u7684\u6700\u540e\u4e00\u5929<br \/>\nSELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))<\/p>\n<p>\u53bb\u5e74\u7684\u6700\u540e\u4e00\u5929<br \/>\nSELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate()), 0))<\/p>\n<p>\u672c\u6708\u7684\u6700\u540e\u4e00\u5929<br \/>\nSELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0))<\/p>\n<p>\u672c\u5e74\u7684\u6700\u540e\u4e00\u5929<br \/>\nSELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate())+1, 0))\u3002<\/p>\n<p>\u672c\u6708\u7684\u7b2c\u4e00\u4e2a\u661f\u671f\u4e00<br \/>\nselect DATEADD(wk, DATEDIFF(wk,0, dateadd(dd,6-datepart(day,getdate()),getdate())), 0)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u65e5\u671f select CONVERT(varchar(10), getdate(), 120) \u4e00\u4e2a\u6708\u7b2c\u4e00\u5929 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":5280,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions\/5280"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}