Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在此语句中注入 sql union 语句。
select id, email, `password` from users where id = 1 union select 1,2,3; order by users.id
但它返回一个错误:
[Err] 1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“order by users.id”附近使用正确的语法
我怎样才能让这个声明起作用?
去掉;前面的ORDER BY子句
;
ORDER BY
select id, email, password from users where id = 1 union select 1,2,3 order by id
更新 1
SELECT id, email, password FROM ( SELECT id, email, password, 1 AS orders FROM users WHERE id = 1 UNION SELECT 1,2,3,2 ) s ORDER BY orders, id