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

mysqlʹÓÃС¼Ç

       ×î½üÓÃmysqlдÁ˼¸¸ö¸´ÔÓµÄÓï¾ä£¬¸Ð¾õÔÚ¹ØϵºÜ¸´ÔÓµÄʱºòÏÈÀíÇå¹ØϵÔÙÑ¡ÔñÓõIJéѯ·½·¨ÊǺÜÖØÒªµÄ£¬ÒòΪͬһ¸öÐèÇó¿ÉÄÜÓò»Í¬µÄ·½·¨À´²é³öÀ´£¬µ«ÊǸ´ÔӶȣ¬ÐÔÄܶ¼²»Ò»Ñù¡£
      ÏÂÃæ˵һÏÂÄÜʵÏÖ¸´ÔÓ²éѯµÄһЩһ°ã·½·¨£º
Ò».withÓï·¨£¨Ê×ÏÈ˵Ã÷£¬ºÃÏñMysql²»Ö§³ÖÕâ¸öÓï·¨£¬µ«ÊÇsqlserverÊÇÖ§³ÖµÄ£©£¬¼´with tableA as select .... from table B¡£Ï൱ÓÚÔÚÊý¾Ý¿âÖн¨Á¢ÁËÒ»¸öÁÙʱ±í¡£ÆäʵÎÒϲ»¶ÕâÖÖÓï·¨£¬ÒòΪ¿´ÆðÀ´ÏñÊÇÃæÏò¶ÔÏóµÄ£¬½á¹¹ÇåÎú¡£
¶þ.½¨Á¢ÁÙʱ±í£¬¼´create temporary table{...},ÆäËûÀàËÆÁË£¬µ«ÊÇÍøÉÏ˵ÕâÖÖ·½·¨¿ªÏúºÜ´ó£¬½¨Ò鿼ÂÇÐÔÄܵÄÓ¦ÓÃÉ÷Óá£
Èý.ǶÌײéѯ£¬¼´select a,b from (select a* as a, b* as b from A*) as A...,ÕâÊǺܳ£Óõķ½·¨£¬Ò²ºÜºÃÓã¬ÐÔÄÜÓ¦¸ÃÒ²²»´í¡£
ËÄ.¸÷ÖÖÁ¬½Ó£¬¼´select a ,b,c from A inner join B inner join C, ÕâÖֽṹÉϵ¹ÊÇÒ²ºÜÇåÎú£¬µ«ÊÇ×î´óµÄȱµã¾ÍÊÇÈßÓàÊý¾ÝÌ«¶à£¬Ôö¼Óϵͳ¸ºµ££¬ÒòΪ±íÖеÄÁÐÄ㶼¸øÁ¬½Ó¹ýÀ´ÁË£¬¶øʵ¼ÊÉÏÊǸù±¾Óò»ÁËÕâô¶àµÄ£¨¿ÉÄÜÖ»ÐèҪÿ¸ö±íÖÐÌض¨µÄ¼¸ÁУ©£¬ÕâÑùÔì³ÉÁ¬½ÓºóµÄ±íÌ«ÅÓ´óÁË£¬ÐÔÄÜÓ¦¸ÃºÜ²î ¡£ ËùÒÔÔÚÄãÈ·¶¨ÈßÓàÊý¾Ý²»¶àʱ£¬¿ÉÒÔÓÃÕâÖÖ·½·¨¡£
×Ô¼ºµÄÐĵ㬿ÉÄÜÒ²²»ÍêÈ«¡£ÆäʵÕæÕýÓõÄʱºòÊǼ¸ÖÖ·½·¨½áºÏÆðÀ´¸üºÃ£¬±ÈÈç
select a,b from (select a* as a from A*) as A inner join (select b* as b from B*) as B on A.some=B.some where a='hello';


Ïà¹ØÎĵµ£º

¹ØÓÚMySQLµÄLIMIT Ó﷨СÓÅ»¯£¡

   
½ñÌìÓÐÅóÓÑÎÊÆð´ËÀàÓï¾äµÄÓÅ»¯£¬ÎÒ´óÖ¸øËû½éÉÜÁËÏ´ÓSQL½Ç¶È×ö¼òµ¥µÄÓÅ»¯£¬ÖÁÓÚÓ¦ÓóÌÐò·½ÃæµÄ¿¼ÂÇÔÛÔÝʱ²»¿¼ÂÇ¡£
ÏÂÃæÎÒÀ´¾ÙÒ»¸ö
¼òµ¥µÄÀý×Ó¡£
¿¼ÂÇÈçÏÂ
±í½á¹¹£º
/*DDL Information
For - t_girl.t_page_sample*/
----------------------------------------------
Table   ......

ÓÉMySQLÖÐcharºÍvarcharЧÂÊÏëµ½µÄ

¶Ô±ÈcharºÍvarcharËæ±ãÔÚgoogle»ò°Ù¶ÈÖÐËÑһϵõ½µÄ½áÂÛ´ó¸Å¶¼ÊÇ"char¶¨³¤,varchar²»¶¨³¤,charÒª±ÈvarcharÕ¼Óøü¶àµÄ¿Õ¼ä,ÓÉÓÚ¶¨³¤charµÄЧÂʸßÓÚvarchar,char×î´ó255,varchar×î´ó65536"¸ü¸ß¼¶Ò»µãµÄÊý¾ÝÊÇ"charÔÚ´æÈëºÍÈ¡³öµÄʱºò,»á×Ô¶¯°ÑĩβµÄ¿Õ¸ñÈ¥µô,varchar»á¶îÍâµÄ¶àÓÃ1-2¸ö×Ö½ÚÀ´´æ·Å×Ö·û³¤¶È,ÁÐÖÐÓÐÒ»¸övarchar» ......

JAVAºÍPHP»ñÈ¡mysql×îºó²åÈëµÄ×ÔÔöidÖµ

phpºÍjavaͨÓÃsqlÓï¾ä·¨
SELECT max(id) from table
¸Ã·½·¨ÔÚ¶àÏ̵߳ÈÇé¿öÏ¿ÉÄÜ»áÔì³É²»ÕýÈ·¡£
javaÈýÖÖ·½·¨
1¡¢¸ù¾ÝpsµÄgetGeneratedKeys
PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); //ºìÉ«Êǹؼü
ps.executeUpdate(); //Ö´Ðкó
ResultSet rs = ps.getGeneratedKeys ......

ʵÏÖPHP·ÃÎÊMYSQLÊý¾Ý¿âµÄÀà

PHPµÄÒ»¸öÊý¾Ý¿â²Ù×÷Àà,ÒÔUTF8¸ñʽдÈë,Êý¾Ý¿âÄÚÖ±½ÓÏÔʾÕý³£ÖÐÎÄ,·ÀÖ¹²éѯ³ö´í
/**
* @author xggxnn
* ±¾ÀàÓÃÓÚʵÏÖÓйØÊý¾Ý¿âµÄ·ÃÎÊ
*
*/
class DBConnection {
private $host = "";
private $user = "";
private $pass = "";
private $DBname = "";
public $isConnected = false;
/**
* ¹¹Ôìº ......

mysql µÄ ÄÚ´æ±íºÍÁÙʱ±í

1 ÄÚ´æ±íµÄ±í»ú¹¹»¹ÊÇÔÚÊý¾Ý¿âÖеģ¬Ö»ÊÇÊý¾Ýʱ·ÅÔÚÄÚ´æÖеġ£
2 ÄÚ´æ±íÖв»¿ÉÒÔʹÓÃTEXTºÍBLOBÀàÐ͵Ä×ֶΡ£
3 ÄÚ´æ±í¿ÉÒÔͨ¹ýmax_heap_table_size = 2048MÀ´¼Ó´óʹÓõÄÄÚ´æ¡£
1 ÁÙʱ±íµÄ±í»ú¹¹ºÍÊý¾Ý¶¼ÊÇ·ÅÔÚÄÚ´æÖеÄ
¾ßÌå¼ûÏ£º
ÄÚ´æ±íʹÓùþϣɢÁÐË÷Òý°ÑÊý¾Ý±£´æÔÚÄÚ´æÖУ¬Òò´Ë¾ßÓм«¿ìµÄËٶȣ¬Êʺϻº´æÖÐСÐÍÊý¾Ý¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ