这可以执行
但在mybatis中PREPARE texts FROM @a就出现异常错误了
异常是
SQL: SET @a=CONCAT('SELECT a.accout_,a.name,a.birthday_,b.name_j FROM users a,role b,users_role c WHERE a.id
=c.user_id
AND b.id_j
=c.role
LIMIT ',(1-1)*3,",",3,'') PREPARE texts FROM @a EXECUTE texts
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'PREPARE texts FROM @a
EXECUTE texts' at line 2
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'PREPARE texts FROM @a
EXECUTE texts' at line 2