27,579
社区成员
发帖
与我相关
我的任务
分享
create table a(productid int ,salecount int)
insert a values(123,2)
insert a values(124,6)
insert a values(125,3)
select min(salecount) from
(select salecount from a where productid =123 union all
select salecount from a where productid =125) b
如果只是:1个A类 + 1个B类
--1
select m.ProductType , n.ProductType from
(select ProductType from 特殊商品表 where ProductType = 'A') m,
(select ProductType from 特殊商品表 where ProductType = 'B') n
--2
select m.ProductType , n.ProductType from 特殊商品表 m , 特殊商品表 n where m.ProductType = 'A' and n.ProductType = 'B'
如果只是:1个A类 + 1个B类
select m.ProductType , n.ProductType from
(select ProductType from 特殊商品表 where ProductType = 'A') m,
(select ProductType from 特殊商品表 where ProductType = 'B') n