Table name : – Trade
TradeNumber spread
1 .1
1 .1
2 .3
2 .4
I want to get all the trades where spread varies. That is my result set should contain only trade number 2.
The query I could construct is
select TradeNumber from Trade t where t.spread <> (select t.spread from TradeNumber)
Didn’t get a chance to run it. Is there an aggregating/ compound function to solve it ?
The least expensive way to do this is:
Using
minandmaxusers fewer resources thancount(distinct).