SQL ʱ¼äµÄ¶Ô±È
ÓÐÕâÑùÒ»¸öÐèÇ󣬲éѯµ±ÌìµÄÊý¾Ý ±íÀï±ßÓиötime×ֶΣ¬ÕâÑù¸ÄÔõô²é°¡£¿ select * from table where time>µ±Ìì0µã and time <µ±Ìì24µã ÍøÉÏÒ²²éÁËÏ select * from table where time BETWEEN µ±Ìì0µã and µ±Ìì24µã µ«ÊǾßÌåÔõô×ö¾Í²»ÖªµÀÁË ÄÇλ°ïæ˵Ï£¬Ð»Ð»¡£
select * from table where datediff(day,[time],getdate()) SQL code: select * from table where datediff(dd , time , getdate()) = 0 select * from table where convert(varchar(10),time,120) = convert(varchar(10),getdate(),120) SQL code: select * from table where datediff(day,[time],getdate())ÒýÓà select * from table where datediff(day,[time],getdate()) select * from table where datediff(day,[time],getdate()) = 0 SQL code: select * from table where datediff(dd,time,getdate()) = 0ÒýÓà ÒýÓà 1 Â¥ feixianxxx µÄ»Ø¸´: select * from table where datediff(day,[time],getdate()) select * fr
Ïà¹ØÎÊ´ð£º
±íÈçÏ ½ÌÊÒID ×ùλÊý ¿ªÊ¼Ê±¼ä ½áÊøÊ±¼ä 2009Äê1ÔÂ1ÈÕ 2009Äê1ÔÂ2ÈÕ 2009Äê1ÔÂ3ÈÕ 101 50 08£º00 08£º30 30 40 50 101 50 09£º00 ......
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ' select cast(convert(numeric(18,2),1275674000000/100000000)as real) ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......
Ö±½ÓÆô¶¯ µãÁ˵ÈÒ»»á¶ù¾Íû·´Ó¦ÁË È¥·þÎñÄÇÀïÆô¶¯»á³öÏÖÈçÏÂÌáʾ ³öÏÖ¡°±¾µØ¼ÆËã»úÉϵÄMSSQLSERVER·þÎñÆô¶¯ºóÓÖÍ£Ö¹ÁË¡£Ò»Ð©·þÎñ×Ô¶¯Í£Ö¹£¬Èç¹ûËüÃÇûÓÐʲô¿É×öµÄ È»ºó»¹ÓÐʲôʲô²»´æÔÚ
......
ÓÐÁ½¸öͬÑùµÄ±í½á¹¹ ±í½á¹¹ÈçÏ£º id£¨ÐòºÅ£© parentid £¨¸¸½áµãÐòºÅ£© name(½áµãÃû³Æ) ±í1 ¼Ç¼ 1 0 aaa 2 ......
Ò»¸öºÜÆæ¹ÖµÄÎÊÌâ SQL code select * from Gprs_DataInof --¿ÉÒԲ鵽ËùÓеÄÊý¾Ý select * from Gprs_DataInof where DataTime between 1900-10-16 1:01:00' and '2009-10-20 1:01:00' --Ò»ÌõÊý¾Ý ......