方法一: select a.ProductId from ancTOP a where exists(select 1 from Products b where a.货号=b.SKU)方法二: select a.ProductId from ancTOP a,Products b where a.货号=b.SKU
上面音讯拼写有错方法一: select a.ProductId from Products a where exists(select 1 from andTOP b where b.货号=a.SKU)方法二: select b.ProductId from andTOP a,Products b where a.货号=b.SKU
如果你想要第一条记录是39530就加排序 order by productId desc 这样就达到要求了,何必去纠结这个排序,又不是没有办法做到
select a.ProductId
from ancTOP a
where exists(select 1 from Products b where a.货号=b.SKU)方法二:
select a.ProductId
from ancTOP a,Products b
where a.货号=b.SKU
select a.ProductId
from Products a
where exists(select 1 from andTOP b where b.货号=a.SKU)方法二:
select b.ProductId
from andTOP a,Products b
where a.货号=b.SKU
如果你想要第一条记录是39530就加排序 order by productId desc
这样就达到要求了,何必去纠结这个排序,又不是没有办法做到