mysqls icon indicating copy to clipboard operation
mysqls copied to clipboard

field 使用 as时不能使用对象的方式设置别名

Open henrychinawyh opened this issue 10 months ago • 0 comments

sql.table('student').field(['id', 'name', {'user_name', 'userName'}]).select()

会有以下错误: sqlMessage: "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 '[object Object],sex FROM student' at line 1",

改为下列方式就可以通过: sql.table('student').field(['id', 'name', 'user_name AS userName']).select()

henrychinawyh avatar Apr 11 '24 02:04 henrychinawyh