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

MYSQL ÓëMSSQL2000 ÔÚÐ޸ıí×ֶεÄÇø±ð

Ìí¼Ó×ֶΣº
MYSQL
alter table tb add col2 varchar(10)
MSSQL2000
alter table tb add col2 varchar(10)
ÐÞ¸Ä×ֶΣº
MYSQL
 alter table tb modify col2 varchar(20)
MSSQL2000
 alter table tb alter column col2 varchar(20)
ɾ³ý×ֶΣº
MYSQL
 alter table tb drop column col2
MSSQL2000
 alter table tb drop column col2


Ïà¹ØÎĵµ£º

½éÉÜmysqlÊý¾Ý¿âÏÂshowÃüÁîµÄÖ÷ÒªÓ÷¨


¡¡¡¡
¡¡¡¡±¾ÎÄÖ÷Òª½éÉÜmysqlÊý¾Ý¿âÏÂshowÃüÁîµÄÖ÷ÒªÓ÷¨£º
¡¡¡¡a. show tables»òshow tables from database_name; -- ÏÔʾµ±Ç°Êý¾Ý¿âÖÐËùÓбíµÄÃû³Æ¡£
¡¡¡¡b. show databases; -- ÏÔʾmysqlÖÐËùÓÐÊý¾Ý¿âµÄÃû³Æ¡£
¡¡¡¡c. show columns from table_name from database_name; »òshow columns from database_name.table_n ......

mysqlË÷ÒýµÄÒ»¸ö¼¼ÇÉ

Õë¶Ôselect * from table where col1 > number order by col2 desc¡£
Æäʵ°´ÕÕ³£¹æµÄ·½·¨¿ÉÒÔÕâÑùÉè¼Æ£ºkey(col1, col2)
µ«ÊÇÕâÖÖ°ì·¨ÔÚmysqlÀï²»ËãÊÇÀíÏëµÄ£¬whereÌõ¼þÀïÏÞ¶¨Ë÷ÒýÇ°²¿·ÖÊÇÒ»¸ö·¶Î§µÄÇé¿öϺóÃæµÄorder by»¹ÊÇ»áÓÐfilesort¡£Èç¹ûwhereÌõ¼þÀïÏÞ¶¨Ë÷ÒýÇ°²¿·ÖÊÇÒ»¸ö³£Á¿£¬ÄÇôorder by¾Í»áÓÐЧÀûÓÃË÷Òý¡£À ......

ÈçºÎÖØÆôMySQL·þÎñ

 RedHat Linux (Fedora Core/Cent OS)
1.Æô¶¯£º/etc/init.d/mysqld start
2.Í£Ö¹£º/etc/init.d/mysqld stop
3.ÖØÆô£º/etc/init.d/mysqld restart
Debian / Ubuntu Linux
1.Æô¶¯£º/etc/init.d/mysql start
2.Í£Ö¹£º/etc/init.d/mysql stop
3.ÖØÆô£º/etc/init.d/mysql restart
Windows
1.µã»÷“¿ªÊ¼&rdq ......

phpÁ¬½ÓmysqlÏê½â

 Èç¹ûÖ»ÊÇÒ»¸öÊý¾Ý¿âµÄ»°£¬ÎÒÃÇÒ»°ãÏ°¹ßÕâÑùд£ºmysql_select_db("guestbook")£»
mysql_query('select * from users');
µ«ÊÇÈç¹ûÊÇÁ¬½Ó¶à¸ömysql£¬ÓпÉÄܳöÏÖͬÃûµÄÊý¾Ý¿â£¬»òÕßÊý¾Ý¿âÖгöÏÖͬÃûµÄ±í£¬ËùÒԾͱØÐëÓÃÍêÕûµÄÐÎʽÁË£¬ÈçÏ´úÂ룺
<?php
$link1 = mysql_connect('localhost1','root','root');
mysql ......

MySQL²éѯ¼°É¾³ýÖظ´¼Ç¼µÄ·½·¨

 ²éѯ¼°É¾³ýÖظ´¼Ç¼µÄ·½·¨
(Ò»)
1¡¢²éÕÒ±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select * from people
where peopleId in (select  peopleId  from  people  group  by  peopleId  having  count(peopleId) > 1)
2¡¢É¾³ý±íÖжàÓàµÄÖظ´¼Ç¼£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ