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

SQL ÈÕÆÚ


MySQL Date º¯Êý
ÏÂÃæµÄ±í¸ñÁгöÁË MySQL ÖÐ×îÖØÒªµÄÄÚ½¨ÈÕÆÚº¯Êý£º
º¯ÊýÃèÊö
NOW()
·µ»Øµ±Ç°µÄÈÕÆÚºÍʱ¼ä
CURDATE()
·µ»Øµ±Ç°µÄÈÕÆÚ
CURTIME()
·µ»Øµ±Ç°µÄʱ¼ä
DATE()
ÌáÈ¡ÈÕÆÚ»òÈÕÆÚ/ʱ¼ä±í´ïʽµÄÈÕÆÚ²¿·Ö
EXTRACT()
·µ»ØÈÕÆÚ/ʱ¼ä°´µÄµ¥¶À²¿·Ö
DATE_ADD()
¸øÈÕÆÚÌí¼ÓÖ¸¶¨µÄʱ¼ä¼ä¸ô
DATE_SUB()
´ÓÈÕÆÚ¼õÈ¥Ö¸¶¨µÄʱ¼ä¼ä¸ô
DATEDIFF()
·µ»ØÁ½¸öÈÕÆÚÖ®¼äµÄÌìÊý
DATE_FORMAT()
Óò»Í¬µÄ¸ñʽÏÔʾÈÕÆÚ/ʱ¼ä
SQL Server Date º¯Êý
ÏÂÃæµÄ±í¸ñÁгöÁË SQL Server ÖÐ×îÖØÒªµÄÄÚ½¨ÈÕÆÚº¯Êý£º
º¯ÊýÃèÊö
GETDATE()
·µ»Øµ±Ç°ÈÕÆÚºÍʱ¼ä
DATEPART()
·µ»ØÈÕÆÚ/ʱ¼äµÄµ¥¶À²¿·Ö
DATEADD()
ÔÚÈÕÆÚÖÐÌí¼Ó»ò¼õÈ¥Ö¸¶¨µÄʱ¼ä¼ä¸ô
DATEDIFF()
·µ»ØÁ½¸öÈÕÆÚÖ®¼äµÄʱ¼ä
CONVERT()
Óò»Í¬µÄ¸ñʽÏÔʾÈÕÆÚ/ʱ¼ä
SQL Date Êý¾ÝÀàÐÍ
MySQL ʹÓÃÏÂÁÐÊý¾ÝÀàÐÍÔÚÊý¾Ý¿âÖд洢ÈÕÆÚ»òÈÕÆÚ/ʱ¼äÖµ£º
DATE - ¸ñʽ YYYY-MM-DD
DATETIME - ¸ñʽ: YYYY-MM-DD HH:MM:SS
TIMESTAMP - ¸ñʽ: YYYY-MM-DD HH:MM:SS
YEAR - ¸ñʽ YYYY »ò YY
SQL Server ʹÓÃÏÂÁÐÊý¾ÝÀàÐÍÔÚÊý¾Ý¿âÖд洢ÈÕÆÚ»òÈÕÆÚ/ʱ¼äÖµ£º
DATE - ¸ñʽ YYYY-MM-DD
DATETIME - ¸ñʽ: YYYY-MM-DD HH:MM:SS
SMALLDATETIME - ¸ñʽ: YYYY-MM-DD HH:MM:SS
TIMESTAMP - ¸ñʽ: ΨһµÄÊý×Ö
SQL ÈÕÆÚ´¦Àí
Èç¹û²»É漰ʱ¼ä²¿·Ö£¬ÄÇôÎÒÃÇ¿ÉÒÔÇáËɵرȽÏÁ½¸öÈÕÆÚ£¡
¼ÙÉèÎÒÃÇÓÐÏÂÃæÕâ¸ö "Orders" ±í£º
OrderIdProductNameOrderDate
1
computer
2008-12-26
2
printer
2008-12-26
3
electrograph
2008-11-12
4
telephone
2008-10-19
ÏÖÔÚ£¬ÎÒÃÇÏ£Íû´ÓÉϱíÖÐÑ¡È¡ OrderDate Ϊ "2008-12-26" µÄ¼Ç¼¡£
ÎÒÃÇʹÓÃÈçÏ SELECT Óï¾ä£º
SELECT * from Orders WHERE OrderDate='2008-12-26'
½á¹û¼¯£º
OrderIdProductNameOrderDate
1
computer
2008-12-26
3
electrograph
2008-12-26
ÏÖÔÚ¼ÙÉè "Orders" ÀàËÆÕâÑù£¨Çë×¢Òâ "OrderDate" ÁÐÖеÄʱ¼ä²¿·Ö£©£º
OrderIdProductNameOrderDate
1
computer
2008-12-26 16:23:55
2
printer
2008-12-26 10:45:26
3
electrograph
2008-11-12 14:12:08
4
telephone
2008-10-19 12:56:10
Èç¹ûÎÒÃÇʹÓÃÉÏÃæµÄ SELECT Óï¾ä£º
SELECT * from Orders WHERE OrderDate='2008-12-26'
ÄÇôÎÒÃǵò»µ½½á¹û¡£ÕâÊÇÓÉÓڸòéѯ²»º¬ÓÐʱ¼ä²¿·ÖµÄÈÕÆÚ¡£
Ìáʾ£ºÈç¹ûÄúÏ£Íûʹ²éѯ¼òµ¥ÇÒ¸üÒ×ά»¤£¬ÄÇôÇë²»ÒªÔÚÈÕÆÚÖÐʹÓÃʱ¼ä²¿·Ö£¡


Ïà¹ØÎĵµ£º

MS SQL Server 2000 ¸´ÖÆ·þÎñÆ÷Òì³£½â¾ö

½ñÌìÐÞ¸ÄÁËÊý¾Ý¿â£¬ÓÚÊǽøÐÐÖØз¢²¼ºÍ¶©ÔÄ£¬Í»È»³öÏÖÁËÒÔÏÂÒì³£
½ø³ÌδÄÜ´óÈÝÁ¿¸´ÖƵ½±í"XS_DDML"ÖÐ
´íÎóÏêϸÐÅÏ¢£º
ÔÚ BCP Êý¾ÝÎļþÖÐÓöµ½µÄÒâÍâµÄ EOF
(Ô´: ODBC SQL Server Driver (ODBC); ´íÎó´úÂë: S1000)
ÓÚÊDzé°ïÖú£¬²éGoogle,ºÇºÇ£¬Google»¹ÕæÊǸöºÃµØ·½£¬ÕÒµ½ÁËÒÔÏÂSQL£¬¾Ý˵¿ÉÒÔ½â¾ö¸ÃÎÊÌâ
sp_configure&n ......

ÓÃSQLÈ¥³ý±íÖÐijÁеÄIdentiferÊôÐÔ

sp_configure 'allow updates', 1
GO
reconfigure with override
GO
update syscolumns set colstat = colstat & 0x0000
where id=object_id('±íÃû') and name='ÁÐÃû'
GO
sp_configure 'allow updates', 0  ......

Ò»¸öprogrammer¹ØÓÚOracle SQLµÄѧϰС½áÓë˼¿¼

http://www.javaeye.com/topic/366991#
×÷Ϊһ¸ö¿ª·¢ÈËÔ±£¬¿ªÊ¼ÈÏÕæϵͳѧϰ
Oracle SQLÒ²Ö»ÓÐÔÂÓ֮࣬ǰµÄ
SQLÖª
ʶ½ö½öÊÇÏîÄ¿ÀïÃæÓõ½Ê²Ã´¾ÍÈ¥¿´Ê²Ã´£¬¼òµ¥Ëµ¾ÍÊÇ
Read The Fxxking Guide¡£ÔÚϵͳѧϰ
Oracle
SQL֮ǰ£¬°³µÄÏë·¨¾ÍÊÇ“°´ÕÕÐèÇóÍê³É¹¦ÄÜ£¬Ê£ÏµĽ»¸ø
DBAÀ´´¦À픡£Õâ¸öÏë·¨´ÓÕûÌåÀ´¿´ÏÔ ......

SQL*LoaderʹÓÃÖ¸ÄÏ

Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½± ......

SQLÖÐDATEADDºÍDATEDIFFµÄÓ÷¨

SQLÖÐDATEADDºÍDATEDIFFµÄÓ÷¨
ÈÕÆÚ:2008-07-17 ×÷Õß:ϲ騰С¶þ 來Ô´:PHPChina
ͨ³££¬妳ÐèÒª獲µÃ當Ç°ÈÕÆÚºÍ計ËãһЩÆäËûµÄÈÕÆÚ£¬ÀýÈ磬妳µÄ³ÌÐò¿ÉÄÜÐèÒªÅÐ斷Ò»個ÔµĵÚÒ»Ìì»òÕß×îááÒ»Ìì¡£妳們´ó²¿·ÖÈË´ó¸Å¶¼ÖªµÀÔõ樣°ÑÈÕÆÚ進ÐзָÄê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ