I have a table as below:
- order_number: int
- device_type: varchar
- revenue: int
I need to query to count number of orders following the below conditions:
(1) device_type = ‘ios’ and revenue > 100
(2) device_type = ‘ios’ and revenue between (200, 300)
(3) everything else as ‘others’
(1) | (2) | Others |
---|---|---|
1000 | 250 | 99 |
Please help. Thank you.
1