Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Column1 Column2
- abc 100
- abc 200
- abc 100 //here 200-100
- Select
- column1,
- sum(
- case when rownum=1
- then column2
- end
- -
- case when rownum=2
- then column2
- end
- )
- from table
- group by column1
- select column1, max(column2) - min(column2)
- from t
- group by column1;
Add Comment
Please, Sign In to add comment