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

mysql²éѯÎÊÌâ

bas_car ±í ÓÐÁÐcarname £¬Òª½øÐÐÊý¾Ýͳ¼Æ£¬ 
select count(a.carname),a.carname from bas_car a,bas_car b where a.carid>=b.carid and a.carname=b.carname
group by a.carname  
ÈçÉϲéѯ½á¹û¡£ ÎÒÏÖÔÚÒªÔÚ½á¹ûÖвúÉúÒ»ÁÐÐÂÐòºÅÁУ¬Èç 1£¬2£¬3£¬4£¬5.
sqlserverÖÐÓÐrow_number() over() ¿ÉÒÔʵÏÖ¡£ 
select count(a.carname),row_number() over(ordery by count(carname) ) as ÐòºÅ,a.carname from bas_car a,bas_car b where a.carid>=b.carid and a.carname=b.carname group by a.carname ¿ÉÒÔʵÏÖ¡£
mysqlÔõôŪ¡£°ï°ï棬´ó¼Ò¡£ Óе㼱¡£¡£


Äܲ»ÄÜÖ±½ÓÏósqlÖÐÒ»Ñù¡£ ÓøösqlÓï¾ä¾Í²éѯ³öÀ´µÄ£¿ 
 ÎÒÊÇÐÂÈË£¬¶ÔÕâ¸öº¯ÊýÖ®ÀàµÄ²»ÊÇÌ«Àí½â¡£
 ²»Ôõô»áÓÃ

ѧϰ
{{


Ïà¹ØÎÊ´ð£º

ÈçºÎ¶¨ÆÚɾ³ýmysqlÊý¾Ý - PHP / »ù´¡±à³Ì

ÇëÎÊÏÂÄܲ»ÄÜÔÙwindows϶¨ÆÚÇå¿ÕmysqlÒ»¸ö±íÖеÄÈ«²¿Êý¾Ý£¬ÓÃPHPʵÏÖ£¡
лл¸÷λÁË
¾Í±ÈÈçÒ»¸öÐÇÆÚÇå¿ÕÒ»´Î
±ÈÈçÿ¸öÐÇÆÚÁùÁãµãÇå¿ÕÒ»´Î£¡
ллÁË

¼Æ»®ÈÎÎñ...php....sql...truncate....OK

Äã¾ÍÕâ½ÓÔÚҳà ......

MYSQLÈçºÎÓëC++Á¬½Ó£¿ - VC/MFC / Êý¾Ý¿â

ÎÒÊÇÐÂÊÖ£¬³õѧMYSQL£¬Óкܶ಻¶®£¬Íû´Í½Ì£¡£¡
±ÈÈç˵ÎÒн¨Ò»¸öMYSQLÊý¾Ý¿âUSER Êý¾Ý¿âÖÐÓбíLIST 
È»ºóÎÒÔÚVCÖÐн¨Ò»¸öMFC¶Ô»°¿ò¹¤³Ì£¬È»ºóÎÒÔõôÑù²ÅÄÜÓÃVC»ñµÃÊý¾Ý¿âÖбíµÄÊý¾Ý£¿
Ï£Íû¸ø³ö¾ßÌåµÄ²Ù×÷² ......

MySQL´íÎó - PHP / »ù´¡±à³Ì

ÎÒ°²×°µÄÕâ¸öÈí¼þVertrigoServ£¬ÔÚwindows7ÖÐÔËÐУ¬Í¼±ê¼ÓºÅΪÀ¶É«£¬±¨MySQLµÄ´íÎó£¬Çë½Ì¸÷λ¸ßÊÖ¸ÃÔõÑù¸ü¸Ä¡£Ð»Ð»¸÷λ£¡
mysql ·þÎñÊÇ·ñÆðÀ´ÁË£¿

ûÓУ¬±¨µÄÊǶ˿ڴíÎó£¬ÔÚÅäÖÃÎļþµ±ÖиÄÁË£¬Ò²²»ÐÐ

¿ÉÒÔÓÃÈ ......

¹ØÓÚMySQLɾ³ý¼Ç¼ºóIDÈçºÎÁªÏµ

id INT NOT NULL PRIMARY KEY AUTO_INCREMENT
È»ºóɾ³ýÊý¾Ý¿âÖеÄÈô¸ÉÖظ´¼Ç¼ºóID±äµÄ²»Á¬Ðø£¬ÈçºÎ±äµÃÁ¬Ðø£¿£¿
ÔËÐÐ
ALTER TABLE tablename DROP id;
ALTER TABLE tablename ADD id INT NOT NULL PRIMARY KEY ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ