select a.item,(a.amount-b.amount) as 差值 from
(
select * from 表 where color='red'
)a,
(
select * from 表 where color='blue'
)b
where a.item=b.item and a.amount>b.amount
select a.item,(a.amount-b.amount) as 差值 from
(
select * from 表 where color='rde'
)a,
(
select * from 表 where color='blue'
)b
where a.item=b.item and a.amount>b.amount