62,074
社区成员
发帖
与我相关
我的任务
分享
select top 6 a.name,b.typename from
glass a left join glasstype b
on(a.typecode=b.selfcode and a.gid not in (select top 6 gid from glass))
group by a.name,b.typename a.typecode,b.selfcode,a.theindex
select top 6 a.name,b.typename from glass a left join glasstype bon a.typecode = b.selfcode where a.gid not in (select top 6 gid from glass)group by a.name,b.typename, a.typecode,b.selfcode,a.theindex
on 是 join的 条件,where 是 select 的条件,得分开写。select top 6 a.name,b.typename
from glass a left join glasstype b
on a.typecode = b.selfcode
where a.gid not in (select top 6 gid from glass)
group by a.name,b.typename, a.typecode,b.selfcode,a.theindex