Mysql±¸·Ý»¹ÔµÄÒ»¸öbug
´Ómysql±¸·Ý³öÀ´µÄsqlÎļþ½øÐл¹Ô²Ù×÷ʱ±¨´í£¬²é¿´´íÎóÈÕÖ¾£¬ÄÚÈÝÈçÏ£º
Error Code: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=50913 DEFAULT CHARSET=gbk' at line 21
ÔÒòÈçÏ£º
µ¼³öÎļþÖеÄÔ´Â룺
PRIMARY KEY (`row_id`) USING BTREE,
UNIQUE KEY `columnAindex` (`columnA`),
KEY `columnBindex` (`columnB`) USING HASH,
KEY `columnCindex` (`columnC`) USING BTREE,
...
ÕýÈ·µÄд·¨:
PRIMARY KEY USING BTREE (`row_id`),
UNIQUE KEY `columnAindex` (`columnA`),
KEY `columnBindex` USING HASH (`columnB`),
KEY `columnCindex` USING BTREE (`columnC`),
...
½«µ¼³öÎļþÖеÄËùÓÐË÷ÒýÀàÐÍ£¨USING BTREE µÈ£©Å²µ½Ë÷ÒýÁУ¨columnBµÈ£©µÄÇ°Ã棬¾ÍÄܹ»Õý³£Íê³Éµ¼Èë²Ù×÷¡£
Ïà¹ØÎĵµ£º
10wÒÔÉÏÊý¾ÝµÄЧÂʱÈÆÕͨ·ÖÒ³ ¿ì4-5±¶
PROCEDURE p_pageList (m_pageNo int , m_perPageCnt int , m_indexcolumn varchar(100), m_column varchar(1000) , m_table varchar(1000) , m_condition varchar(1000), m_orderBy varchar(200) , inout m_totalPageCnt int)
BEGIN
IF m_totalPageCnt >=1 THEN
S ......
1. ʲôÊDzÎÕÕÍêÕûÐÔ?
——————–
²ÎÕÕÍêÕûÐÔ(ÍêÕûÐÔÔ¼Êø)ÊÇÊý¾Ý¿âÉè¼ÆÖеÄÒ»¸öÖØÒª¸ÅÄµ±Êý¾Ý¿âÖеÄÒ»¸ö±íÓëÒ»¸ö»ò¶à¸ö±í½øÐйØÁªÊ±¶¼»áÉæ¼°µ½²ÎÕÕÍêÕûÐÔ¡£±ÈÈçÏÂÃæÕâ¸öÀý×Ó£º
ÎÄÕ·ÖÀà±í - categories
category_id &n ......
Mysql°²×°
MysqlµÄ°²×°Îļþ¿ÉÒÔÖ±½Óµ½ http://www.mysql.com ÏÂÔØ£¬»ñµÃfor win32µÄ.zip°ü£¬½¨ÒéÑ¡Ôñ4.0.20d°æ±¾¡£ÕâÀï²»Ïêϸ˵Ã÷¡£
¡¡¡¡ÏÂÔØ»ñµÃMysqlµÄfor win32°²×°°üºó£¬ÓÃwinzip½âѹËõ£¬Ö±½ÓÔËÐÐsetup.exe£¬ÐèҪעÒâµÄÊÇÑ¡ÔñÒ»¸ö°²×°Â·¾¶£¬µ±È»£¬°²×°Â·¾¶¿ÉÒÔÈÎÒ⣬½¨ÒéÑ¡ÔñC:\MySQLĿ¼¡£°²×°Íê³ÉºóMySQLÒ²¾ÍÍê³É ......
ʹÓÃmysqlÓÖÓöµ½ÎÊÌâÁË£¬Õâ´ÎÊǹØÓÚÂÒÂëµÄ...
ÆäʵÎÒÒ²±È½ÏÁ˽â±àÂëµÄÎÊÌ⣬Ҳ֪µÀÂÒÂë²úÉúµÄÔÀí£¬¶øÇÒÍøÉ϶ÔmysqlµÄÂÒÂëÎÊÌâÒ²ÓбȽ϶àµÄ½â´ð£¬
µ«ÊǽñÌìÎÒÓöµ½µÄÕâ¸öÂÒÂëÈ´±È½ÏÆæ¹Ö,ÔÚwhenÓï¾äÖвúÉúÁËÆæ¹ÖµÄÂÒÂë¡£
create table my_table(id int, name varchar(50), born DateTime);
insert into my_table val ......
select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc ¾¹È»ÓÐÁ½¸öÊýÁ ......