这句SQL语句:select * from tableName as A join (select id from tableName where 1=1 order by createTime DESC limit 0,10) as B on A.id=B.id
在其他地方能正常执行,在活字格的“执行SQL命令”中执行报:
[size=13.333px]执行SQL命令调用失败
[size=13.333px]A column named 'id' already belongs to this DataTable.
[size=13.333px]什么原因,各位大佬给看一下。
[size=13.333px]
谢谢提醒!
子查询指定字段别名,改成:select * from tableName as A join (select id as sid from tableName where 1=1 order by createTime DESC limit 0,10) as B on A.id=B.sid
就可以完美避开重复列名了.