Error Code: 1060. Duplicate column name - 已解决

Error Code: 1060. Duplicate column name '',mysql提示出现重复的列名。

问题:

SELECT * FROM (SELECT 'admin','admin' ) AS	tmp

解决:

SELECT * FROM (SELECT 'admin' as `username`,'admin' as `rolename`) AS	tmp

说明:为相同数据的列加上别名。