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

ms sql dateimeÖ®1905

 ÔÚ×ö“¶¼ÊмÒÔ°”ÓÅ»¯Ê±£¬¾ßÌåÊÇÓû§×¢²áʱ£¬Ìá½»ÐÅÏ¢£¬±¾À´BirthdayÊÇûÓÐдÈëÖµµÄ£¬´Ë×Ö¶ÎҲûÓÐĬÈÏÖµ£¬¿ÉÊý¾Ý¿âÖÐȴΪ“1905/3/14 0:00:00”£¬ÓôÃÆÖÁ¼«£¬ÉÏgoogle&baiduÒ²ÊÇûÓнâ¾öµÄ·½°¸¡£
Ö»ÄÜÕâÑùԭʼµÄ½â¾ö£º
Register ´æ´¢¹ý³Ì
   insert into UserInfo(UserID,sex) VALUES(@NewUid,@Sex,)
   ¸ü¸ÄΪ£º
   insert into UserInfo(UserID,sex,Birthday) VALUES(@NewUid,@Sex,'1980-01-01')
Óû§µÚ¶þ´ÎµÇ¼ºóÔÙÐ޸ļ´¿É¡£
Ô­À´¾¹È»ÊÇ1905/3/14£¬Óе㻬»ü¡£
±¾ÎÄÊ×·¢£ºhttp://www.edongguan.com/blog/b176.aspx


Ïà¹ØÎĵµ£º

SQL ServerʹÓÃBulk Insert°ÑÒ»¸öÎı¾µ¼Èëµ½Êý¾Ý¿â

 
This is very common request recently – How to import CSV file into SQL Server? How to load CSV file into SQL Server Database Table? How to load comma delimited file into SQL Server? Let us see the solution in quick steps.
CSV stands for Comma Separated Values, sometimes also called Co ......

sql DATEPART£¨£©º¯Êý

cdateÊÇdatetimeÀàÐ͵Ä×Ö¶Î
ͳ¼ÆÒ»ÄêµÄÈçÏÂ
 select datepart(yy,cdate) as 'Ô·Ý',sum(cmoney) from consumption group by datepart(yy,cdate)
ͳ¼ÆÒ»ÔµÄÈçÏÂ
 select datepart(mm,cdate) as 'Ô·Ý',sum(cmoney) from consumption where datepart(yy,cdate)=2009 group by datepart(mm,cdate)
ͳ¼ÆÒ»ÖÜ ......

½«MySQLÖÐsqlÔËÐнá¹û±£´æµ½Îļþ

 ÓÐÁ½ÖÖ·½·¨¡£
·½·¨Ò»£ºÔÚmysql>Ìáʾ·ûÖÐʹÓÃtee
mysql> tee output.txt
Logging to file 'output.txt'
mysql> notee
Outfile disabled.
»òÕß
mysql> \T output.txt
Logging to file 'output.txt'
mysql> \t
Outfile disabled.
Õâ¸öÀàËÆÓÚsqlplusµÄspool¹¦ÄÜ£¬¿ÉÒÔ½«ÃüÁîÐÐÖеĽá¹û±£´æµ½Í ......

SQL³£ÓÃÃüÁîʹÓ÷½·¨

 
(1) Êý¾Ý¼Ç¼ɸѡ£º
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû=×Ö¶ÎÖµ order by ×Ö¶ÎÃû [desc]"
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû like '%×Ö¶ÎÖµ%' order by ×Ö¶ÎÃû [desc]"
sql="select top 10 * from Êý¾Ý±í where ×Ö¶ÎÃû order by ×Ö¶ÎÃû [desc]"
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû in ('Öµ ......

SQLÖÐÈçºÎÕýÈ·ÈÏʶ´¥·¢Æ÷

¶ÔÓÚ³õѧÕ߶Դ¥·¢Æ÷µÄÀí½âÍùÍù²»ÊǺÜ͸³¹£¬¼ÇµÃ×Ô¼ºµ±³õѧµÄʱºò×ÜÓеãÃþ²»ÇåÍ·ÄԵĸоõ£¬½ñÌì¾ÍÏëÆðºÍ´ó¼Ò×ܽáһϣ¬Èç¹ûÎÄÕ³öÏÖЩ覴ÃÇë¸ßÊÖ¶à¶àÖ¸½ÌŶ£¡
´¥·¢Æ÷ÊÇÊý¾Ý¿â·þÎñÆ÷Öз¢Éúʼþʱ×Ô¶¯Ö´ÐеÄÌØÊâ´æ´¢¹ý³Ì£¬Ëü²åÈ롢ɾ³ý»òÐÞ¸ÄÌرíÖеÄÊý¾Ýʱ´¥·¢Ö´ÐС£´¥·¢Æ÷ͨ³£¿ÉÒÔÇ¿ÖÆÖ´ÐÐÒ»¶¨µÄÒµÎñ¹æÔò£¬ÒÔ±£³ÖÊý¾ÝÍêÕûÐÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ