MySQL错误:Every derived table must have its own alias
Select distinct(LAC_CI) from (Select LAC_CI from `dtdb_sh_test`.dt_measurment where callid='04021002ms31310379260576' union Select LAC_CI from `dtdb_sh_test`.dt_measurment where callid='04021002ms31310379260576')
在执行稍微复杂查询的时候,
MySQL有时会遇到如下报错情况:
Error Code : 1248
Every derived table must have its own alias
解决方法:
在执行复杂查询处为你的表任意起个别名就可以了。
Select distinct(LAC_CI) from (Select LAC_CI from `dtdb_sh_test`.dt_measurment t where t.callid='04021002ms31310379260576' union Select LAC_CI from `dtdb_sh_test`.dt_measurment d where d.callid='04021002ms31310379260576') as t
此处 as t 虽然无任何作用和意义,但是SQL语句是万万少不得的。