select * FROM (select log.id,u.user_id,log.uname,log.userip,log.vmip,vm.id,log.vmname,log.course,log.mac,log.port,log.plat,log.stime,log.id FROM `vslab`.`vm_log` as log,`vslab`.`user` as u,`vslab`.`vmdisk` as vm WHERe u.username=log.uname AND log.vmname=vm.name
) as A WHERe a.uname LIKE '%网管%'
OR a.course LIKE '%网管%'
OR a.vmnme LIKE '%网管%'
如下错误
#1060 - Duplicate column name 'id'
mysql查询语句错误帮忙改正 难!
答案:2 悬赏:30 手机版
解决时间 2021-01-26 20:29
- 提问者网友:原来太熟悉了会陌生
- 2021-01-26 17:34
最佳答案
- 五星知识达人网友:掌灯师
- 2021-01-26 18:42
有两个log.id - -你试试
select * FROM (select log.id,u.user_id,log.uname,log.userip,log.vmip,vm.id,log.vmname,log.course,log.mac,log.port,log.plat,log.stime FROM `vslab`.`vm_log` as log,`vslab`.`user` as u,`vslab`.`vmdisk` as vm WHERe u.username=log.uname AND log.vmname=vm.name
) as A WHERe a.uname LIKE '%网管%'
OR a.course LIKE '%网管%'
OR a.vmnme LIKE '%网管%'
select * FROM (select log.id,u.user_id,log.uname,log.userip,log.vmip,vm.id,log.vmname,log.course,log.mac,log.port,log.plat,log.stime FROM `vslab`.`vm_log` as log,`vslab`.`user` as u,`vslab`.`vmdisk` as vm WHERe u.username=log.uname AND log.vmname=vm.name
) as A WHERe a.uname LIKE '%网管%'
OR a.course LIKE '%网管%'
OR a.vmnme LIKE '%网管%'
全部回答
- 1楼网友:低血压的长颈鹿
- 2021-01-26 20:17
你这个语句那么多重嵌套当然慢了,哪有这么写的。用多表连接查询不就行了么
select a.*
from user a,inds b,skills c
where c.workerid=a.id and b.id=c.indid
and a.id<>'' and a.city=255 and a.classid in (0,2)
and b.id in(129) and b.indid=0
order by b.indid desc
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯