declare @a table(品名 varchar(10),只数 int,重量 int,单价 money,计价类别 varchar(10))insert @a values('aa',11,11,0.11,'只数')insert @a values('bb',11,11,0.11,'重量')insert @a values('cc',11,11,0.11,'重量')select * from @aselect a.*from @a a,(select (case when count(*)>0 then '只数' else '重量' end) lb from @a where 计价类别='只数') as bwhere a.计价类别=b.lb and 只数>10 and 重量>10