'How to specified below value from base record query?
I have table like this and I need to specify below price than base price in table.
id value price base
1 aaa 100
2 bbb 200
3 ccc 300 Yes
4 aaa 200 Yes
5 aaa 300
6 aaa 400
like this :
id value price status
1 aaa 100 down
2 bbb 200
3 ccc 300 base
4 aaa 200 base
5 aaa 300 up
6 aaa 400 up
With this code I can get max and min price value:
SELECT
min(price) as min_price
, max(price) as max_price
FROM
(
select *
From MyTable
) tmp;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
