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

MySQLÖÐÓÃsqlÓï¾ä²åÈëʱÆÚ

mysql> create table testdate(
         -> id int not null auto_increment primary key,
         -> time date);
Query OK, 0 rows affected (0.30 sec)
mysql> insert into testdate(time) values('2010-4-23');
Query OK, 1 row affected (0.06 sec)
mysql> select * from testdate;
+----+------------+
| id | time            |
+----+------------+
| 1       | 2010-4-23|
+----+------------+
1 row in set (0.00 sec)
mysql> alter table testdate add column current time;
Query OK, 1 row affected (0.25 sec)
Records: 1      Duplicates: 0      Warnings: 0
mysql> update testdate set current='21:18:00' where id=1;
Query OK, 1 row affected (0.06 sec)
Rows matched: 1      Changed: 1      Warnings: 0
mysql> select * from testdate;
+----+------------+----------+
| id | time           | current      |
+----+------------+----------+
| 1      | 2010-4-23 | 21:18:00 |
+----+------------+----------+
1 row in set (0.00 sec)
mysql> alter table testdate add column combine timestamp;
Query OK, 1 row affected (0.14 sec)
Records: 1     Duplicates: 0     Warnings: 0
mysql> update testdate set combine='20050504212000' where id=1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1     Changed: 0     Warnings: 0
mysql> select * from testdate;
+----+------------+----------+---------------------+
| id | time          | current     | combine                |
+----+-------


Ïà¹ØÎĵµ£º

mysqlÃüÁîÐÐ HAVING×Ó¾ä UNION

ÎÒÔÚmysql ÃüÁîÐÐÕâ¸öϵÁÐÀï½éÉܹýÓÐÌõ¼þ²éѯ£¬ËüÓõ½WHERE×Ӿ䡣µ«ÊÇÓÐʱºòÓÃWHERE×Ó¾äÎÞ·¨¸øÎÒÃǵIJéѯ¼ÓÈëÌõ¼þ£¬±ÈÈçÔÚÉÏÒ»½ÚÎÒÃÇѧϰµÄGROUP BY(°´×é¹éÀà)×Ӿ䣬Èç¹ûÎÒÃÇÒªÔÚ°´×é¹éÀàºó¼ÓÈëÌõ¼þ£¬ÓÃWHERE¾ÍÐв»Í¨£¬ÒòΪWHEREÖ»¿ÉÒÔÔÚ°´×é¹éÀàÇ°¼ÓÈëÌõ¼þ¡£ºÃÔÚmysqlÌṩHAVING×Ӿ䣬Ëü¿ÉÒÔ°ïÎÒÃǽâ¾öÕâ¸öÎÊÌâ¡£
ÈçºÎÊ¹Ó ......

SQL·þÎñÆ÷£ºCONVERTÓëCASTÇø±ðºÎÔÚ


Èç¹ûSQL Server³ÌÐòÔ±Ï뽫±í´ïʽ´ÓÒ»ÖÖ»»ÎªÁíÒ»ÖÖ£¬Ëû¿ÉÒÔ´ÓSQL Server 7ºÍ2000ÖÐ×Ô´øµÄÁ½ÖÖ¹¦ÄÜÖÐ×ö³öÑ¡Ôñ¡£ÔÚ´æ´¢¹ý³Ì»òÆäËûÇé¿öÏ£¬ÎÒÃdz£³£ÐèÒª½«Êý¾Ý´ÓdatetimeÐÍת»¯³ÉvarcharÐÍ£»CONVERTºÍCAST¾Í¿ÉÒÔÓÃÓÚÕâÖÖÇé¿ö¡£
¡¡¡¡ÓÉÓÚSQL ServerÌṩÁ½ÖÖ¹¦ÄÜ£¬Òò´ËÓ¦¸ÃÑ¡ÔñÄÄÖÖ¹¦ÄÜ»òÓ¦¸ÃÔÚÄÄÖÖÇé¿öÏÂʹÓøù¦ÄܾͺÜÈÝÒ×Èà ......

SQLÈÕÆÚ¸ñʽ»¯Ó¦ÓôóÈ«


Sql Server ÖÐÒ»¸ö·Ç³£Ç¿´óµÄÈÕÆÚ¸ñʽ»¯º¯Êý
--
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(10 ......

Win7ÏÂÃæPL/SQLÎÞ·¨Ê¹ÓÃ

½ñÌì·¢ÏÖÔÚʹÓÃPL/SQLʱ£¬ÎÞ·¨µÇ½¡£¾­¹ýȺÀïÅóÓѵİï棬×îºóÔ²Âú½â¾ö£¬ÏÖÁô¸ö¼Ç¼ÒÔ±ãÒÔºó¿É²é¡£
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ