排错 select select imgSrc from imgs i where iisMain=是imgsrc from product p
缺少语句结束符号,应该在最后加上分号";"。同时,子查询中缺少与外层表的关联条件,需要添加一个条件来连接两个表。
正确的语句应该是:
select *,(select imgSrc from imgs i where i.isMain='是' and i.productId = p.productId) as 'imgsrc' from product p;
原文地址: http://www.cveoy.top/t/topic/fV8h 著作权归作者所有。请勿转载和采集!