Mysql ʱ¼äº¯Êý»ã×Ü
Ò»¡¢MySQL »ñµÃµ±Ç°ÈÕÆÚʱ¼ä º¯Êý
1.1 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºnow()
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-08-08 22:20:46 |
+---------------------+
³ýÁË now() º¯ÊýÄÜ»ñµÃµ±Ç°µÄÈÕÆÚʱ¼äÍ⣬MySQL Öл¹ÓÐÏÂÃæµÄº¯Êý£º
current_timestamp()
,current_timestamp
,localtime()
,localtime
,localtimestamp -- (v4.0.6)
,localtimestamp() -- (v4.0.6)
ÕâЩÈÕÆÚʱ¼äº¯Êý£¬¶¼µÈͬÓÚ now()¡£¼øÓÚ now() º¯Êý¼ò¶ÌÒ׼ǣ¬½¨Òé×ÜÊÇʹÓà now() À´Ìæ´úÉÏÃæÁгöµÄº¯Êý¡£
1.2 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºsysdate()
sysdate() ÈÕÆÚʱ¼äº¯Êý¸ú now() ÀàËÆ£¬²»Í¬Ö®´¦ÔÚÓÚ£ºnow() ÔÚÖ´ÐпªÊ¼Ê±Öµ¾ÍµÃµ½ÁË£¬ sysdate() ÔÚº¯ÊýÖ´ÐÐʱ¶¯Ì¬µÃµ½Öµ¡£¿´ÏÂÃæµÄÀý×Ó¾ÍÃ÷°×ÁË£º
mysql> select now(), sleep(3), now();
+---------------------+----------+---------------------+
| now() | sleep(3) | now() |
+---------------------+----------+---------------------+
| 2008-08-08 22:28:21 | 0 | 2008-08-08 22:28:21 |
+---------------------+----------+---------------------+
mysql> select sysdate(), sleep(3), sysdate();
+---------------------+----------+---------------------+
| sysdate() | sleep(3) | sysdate() |
+---------------------+----------+---------------------+
| 2008-08-08 22:28:41 | 0 | 2008-08-08 22:28:44 |
+---------------------+----------+---------------------+
¿ÉÒÔ¿´µ½£¬ËäÈ»ÖÐ; sleep 3 Ã룬µ« now() º¯ÊýÁ½´ÎµÄʱ¼äÖµÊÇÏàͬµÄ£» sysdate() º¯ÊýÁ½´ÎµÃµ½µÄʱ¼äÖµÏà²î 3 Ãë¡£MySQL Manual ÖÐÊÇÕâÑùÃèÊö sysdate() µÄ£ºReturn the time at which the function executes¡£
sysdate() ÈÕÆÚʱ¼äº¯Êý£¬Ò»°ãÇé¿öϺÜÉÙÓõ½¡£
2. »ñµÃµ±Ç°ÈÕÆÚ£¨date£©º¯Êý£ºcurdate()
mysql> select curdate();
+------------+
| curdate() |
+------------+
| 2008-08-08 |
+------------+
ÆäÖУ¬ÏÂÃæµÄÁ½¸öÈÕÆÚº¯ÊýµÈͬÓÚ curdate()£º
current_date()
,current_date
3. »ñµÃµ±Ç°Ê±¼ä£¨time£©º¯Êý£ºcurtime()
mysql> select curtime();
+-----------+
| curtime() |
+-----------+
| 22:41:30 |
+-----------+
ÆäÖУ¬ÏÂÃæµÄÁ½¸öʱ¼äº¯ÊýµÈͬÓÚ curtime()£º
current_time()
,current_
Ïà¹ØÎĵµ£º
MySQL´Ó4.1¿ªÊ¼Ö§³ÖSQLµÄ×Ó²éѯ¡£Õâ¸ö¼¼Êõ¿ÉÒÔʹÓÃSELECTÓï¾äÀ´´´½¨Ò»¸öµ¥ÁеIJéѯ½á¹û£¬È»ºó°ÑÕâ¸ö½á¹û×÷Ϊ¹ýÂËÌõ¼þÓÃÔÚÁíÒ»¸ö²éѯÖС£ÀýÈ磬ÎÒÃÇÒª½«¿Í»§»ù±¾ÐÅÏ¢±íÖÐûÓÐÈκζ©µ¥µÄ¿Í»§É¾³ýµô£¬¾Í¿ÉÒÔÀûÓÃ×Ó²éѯÏÈ´ÓÏúÊÛÐÅÏ¢±íÖн«ËùÓз¢³ö¶©µ¥µÄ¿Í»§IDÈ¡³öÀ´£¬È»ºó½«½á¹û´«µÝ¸øÖ÷²éѯ£¬ÈçÏÂËùʾ£º
DELETE from ......
<!--#include file="zheboconn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>aspºÍmysql·ÖÒ³´úÂë</title>
<style type="text/css">
<!--
.STYLE3 {
fon ......
1.Ç°ÃæһƪÎÄÕÂÏêϸ½éÉÜÁËÈçºÎÔÚWindowsÏÂÕûºÏapache+mysql+php+tomcat,ºÜ¼òµ¥£¬µ«ÊÇÔÚLinuxϾÍûÕâôÈÝÒ×ÁË£¬ÐèÒªÊÖ¹¤µÄȥдÅäÖÃÎļþ£¬ÍøÉϵÄ×ÊÁÏÓкܶ࣬µ«ÊÇÎÒ¸ù¾ÝËûÃǵÄд·¨£¬Ò»²½Ò»²½µÄÅäÖû¹ÊÇûÄÜsuccess!£¨¿ÉÄÜÊÇÎÒ¸öÈ˵ÄÔÒò£¬²»¹ý£¬ÎÞÂÛÔÚGoogle»¹ÊÇbaiduËѵ½µÄÎÄÕ¾ÍÄÇô¼¸Æª£¬Õâ¸öתһÏ£¬ÄǸöתһÏ£¬×îºó¶¼² ......
·µ»ØÒ»¸ö½á¹ûÈ«ÊÀ½ç¶¼ÖªµÀÔõô´¦Àí£¬¹Ø¼üÊÇ·µ»Ø¶à¸ö½á¹û¼¯¾Í²»ºÃ°ìÁË£¬ÏÂÃæÓÐÒ»½â¾ö°ì·¨
´æ´¢¹ý³Ì´úÂë
DELIMITER $$;
DROP PROCEDURE IF EXISTS `test`.`sp_test`$$
CREATE PROCEDURE `test`.`sp_test` ()
BEGIN
select * from `user`.`user` limit 0, 50;
select coun ......
MysqlËùÖ§³ÖµÄÒýÇæÄ¿Ç°ÓÐÒÔϼ¸ÖÖ£º
MyISAM,InnoDB,MERGE,MEMORY(HEAR),BDB(BerkeleyDB),EXAMPLE,FEDERATED,ARCHIVE,CSV,BLACKHOLE.
ΪʲôҪÓÐÕâô¶àÒýÇ棿Ö÷ÒªÊÇMysqlÊÇÒ»¿î¼«ÎªÇ¿´óµÄÊý¾Ý¿â£¬ËüÊÊÓ¦ºÜ¶à²»Í¬µÄÔËÐл·¾³£¬ÎªÁËÂú×ã¸÷ÖÖ²»Í¬µÄÔËÐл·¾³Óë´æ´¢·½°¸µÄÐèÒª£¬ÕâЩËÑË÷ÒýÇæÒ²¾ÍÓ¦Ô˶øÉú£¨²»¹âÊÇΪÁËÅäºÏMysql ......