Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎÊ´ð£º

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

±íÈçÏÂ
½ÌÊÒID ×ùλÊý ¿ªÊ¼Ê±¼ä ½áÊøÊ±¼ä 2009Äê1ÔÂ1ÈÕ 2009Äê1ÔÂ2ÈÕ 2009Äê1ÔÂ3ÈÕ
  101 50 08£º00 08£º30 30 40 50  
  101 50 09£º00 ......

sqlת»»ÎÊÌ⣬¼±£¡ - ÉçÇøÖ§³Ö / ¡¶³ÌÐòÔ±¡·ÔÓÖ¾

select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......

sql 2000 ·þÎñÆô¶¯²»ÁË

Ö±½ÓÆô¶¯ µãÁ˵ÈÒ»»á¶ù¾Íû·´Ó¦ÁË È¥·þÎñÄÇÀïÆô¶¯»á³öÏÖÈçÏÂÌáʾ  
³öÏÖ¡°±¾µØ¼ÆËã»úÉϵÄMSSQLSERVER·þÎñÆô¶¯ºóÓÖÍ£Ö¹ÁË¡£Ò»Ð©·þÎñ×Ô¶¯Í£Ö¹£¬Èç¹ûËüÃÇûÓÐʲô¿É×öµÄ 
È»ºó»¹ÓÐʲôʲô²»´æÔÚ  ......

Èç¹ûдµÝ¹ésqlÓï¾ä - MS-SQL Server / Ó¦ÓÃʵÀý

ÓÐÁ½¸öͬÑùµÄ±í½á¹¹ 
±í½á¹¹ÈçÏ£º
  id£¨ÐòºÅ£© parentid £¨¸¸½áµãÐòºÅ£© name(½áµãÃû³Æ)
 ±í1 ¼Ç¼ 1 0 aaa
  2 ......

SQLʱ¼ä¶ÎÎÊÌâ

Ò»¸öºÜÆæ¹ÖµÄÎÊÌâ 
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'
--Ò»ÌõÊý¾Ý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ