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语句是万万少不得的。


转载于:https://www.cnblogs.com/googlegis/archive/2011/12/22/2978760.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值