我遇到
SELECT 将检查超过 MAX_JOIN_SIZE 行;检查您的 WHERE 并使用 SET SQL_BIG_SELECTS=1 或 SET SQL_MAX_JOIN_SIZE=# 如果 SELECT 没问题
我的ASP代码出错。ASP 代码具有与 MySQL 的服务器端 ADODB 连接,并且连接似乎无法执行多个查询。如何在我的代码中实现SQL_BIG_SELECTS = 1 ?
Set obj_db = Server.CreateObject("ADODB.Connection")
Session("ConnectionString") = "dsn=dsn1016189_mysql;uid=apns;pwd=mypassword;DATABASE=mydb;APP=ASP Script;STMT=SET CHARACTER SET SJIS"
obj_db.Open Session("ConnectionString")
Set obj_ret = Server.CreateObject("ADODB.Recordset")
obj_ret.CursorLocation = 3
并执行 SQL...
SQL_BIG_SELECTS = 1; SELECT pu.login_id, pu.p_login_id, pu.first_name, pu.last_name, pu.sex, pu.is_admin, pu.attendance, pu.invited, pu.reason, qaa1.answer AS qaa1_answer, COUNT(pu2.p_login_id) AS companion
FROM party_user pu
LEFT OUTER JOIN party_user pu2
ON pu2.p_login_id = pu.login_id
LEFT OUTER JOIN qa_answer qaa1
ON qaa1.login_id = pu.login_id AND qaa1.party_id = pu.party_id AND qaa1.sort_num = '1' WHERE pu.party_id = '92' AND pu.p_login_id = '' GROUP BY pu.login_id, pu.p_login_id, pu.first_name, pu.last_name, pu.sex, pu.is_admin, pu.attendance, pu.reason, qaa1.answer, pu.invited ORDER BY pu.login_id ASC;
我无法执行多个查询,上面的查询变成错误。
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 'SELECT pu.login_id, pu.p_login_id, pu.first_name, pu.last_name, pu.sex, pu.is_ad' at line 1