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

Çó¸ßÊÖÐÞ¸ÄÒ»MYSQLÓï¾ä

ÏÖÓÐMYSQLÓï¾ä
SQL code:
select t.id,a.uid,a.uname,t.ucomment,t.utime
from a left join b t using(uid)
where 2>(select count(*) from b where uid=t.uid and utime<t.utime)
and a.uid<=6



²»¹ý´Ë´¦µÄa.uid <6°ÑuidµÄÖµ¹Ì¶¨×¡ÁË£¬
ÈçºÎÐÞ¸Äһϣ¬ÀûÓÃuidµÄÖµ½øÐзÖÒ³²éÑ¯ÄØ
Ö»ÓÐÓÃSP£¬½«²ÎÊý´«µÝ½øÈ¥
ÀàËÆ
select t.id,a.uid,a.uname,t.ucomment,t.utime
from a left join b t using(uid)
where 2>(select count(*) from b where uid=t.uid and utime <t.utime)
and a.uid <=cuid

call sp(6)

select t.id,a.uid,a.uname,t.ucomment,t.utime
from a left join b t using(uid)
where 2>(select count(*) from b where uid=t.uid and utime <t.utime)
limit 20,10

limit 20,10 ÏÔʾµÚ21Ìõ¼Ç¼µ½µÚ30¹²10Ìõ¼Ç¼¡£Äã¿ÉÒÔÓÃÕâ¸öÀ´·ÖÒ³¡£

ÒýÓÃ
select t.id,a.uid,a.uname,t.ucomment,t.utime
from a left join b t using(uid)
where 2>(select count(*) from b where uid=t.uid and utime <t.utime)
limit 20,10

limit 20,10 ÏÔʾµÚ21Ìõ¼Ç¼µ½µÚ30¹²10Ìõ¼Ç¼¡£Äã¿ÉÒÔÓÃÕâ¸öÀ´·ÖÒ³¡£


ÿҳҪ²é³ö10¸öuidÏà¶ÔÓ¦µÄÐÅÏ¢£¬ËùÒÔ˵ÕâÑùÊDz»ÐеÄ

http://topic.csdn.net/u/20100108/15/62c5af0c-3ba4-4816-8117-02b489db57cd.html
½¨SQLÓï¾äÔÚÕâ¸öÁ´½ÓÀïÃæ



Ïà¹ØÎÊ´ð£º

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

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

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

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

ÔõôÔÚeclipseÏÂÏòmysql²åÈë±äÁ¿°¡ - Java / JavaÏà¹Ø

String SQL="insert into ѧÉúÐÅÏ¢±í values(StudentNumber,StudentName,StudentAge)";ÆäÖÐStudentNumber,StudentName,StudentAge¶¼ÊDZäÁ¿¡£ÕâÑùд²»¶Ô¡­¡­µ½µ×¸Ãզд°¡

Íò·Ö¸Ðл£¡

String SQL=&q ......

mysqlÖÐÎÄÂÒÂë - C/C++ / C++ ÓïÑÔ

mysqlÊý¾Ý¿âµÄ±àÂë¸ñʽÊÇutf8
ÔÚc++³ÌÐòÖÐʹÓÃC APIÖ±½ÓÁ¬½ÓmysqlÊý¾Ý¿â£¬°ÑÖÐÎı£´æµ½mysqlÊý¾Ý¿âÖУ¬ÖÐÎç±ä³ÉÂÒÂë
ʹÓÃmysqlµÄloadÃüÁîµ¼ÈëÎı¾Îļþ£¬ÎÞÂÛÎı¾ÎļþÊÇANSI»¹ÊÇutf8±àÂ룬¶¼ÊÇÂÒÂë
ÇëÎÊÉÏÃæÁ½¸öÎÊ ......

JavaScriptÔõÑùÁ¬½ÓMySQLÊý¾Ý¿â£¿

ÓÐÒ»¸öjsÎļþ£¬ÊÇʵÏÖÎÄ×Ö¹ö¶¯µÄ£¬ÆäÖеıäÁ¿ÐèÒªµ½mysqlÊý¾Ý¿âÖжÁÈ¡£¬ÄÇôÔõÑùʵÏÖÊý¾Ý¿âÁ¬½Ó¶ø¶ÁÈ¡Êý¾Ý£¿
ÎÒÊDzËÄñ£¬×îºÃÓÐÍêÕûµÄ´úÂëºÍ½âÊÍ£¬Ð»Ð»¸÷λ´óϺ°¡°¡°¡°¡°¡°¡£¡£¡£¡
http://blog.csdn.net/jemlee2002 ......

¹ØÓÚ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ºÅ