1SELECT CASE col1
2 WHEN 'agree' THEN 'Ok'
3 WHEN 'disagree' THEN 'Ko'
4 ELSE
5 CASE
6 WHEN col2 >= 1 THEN 'Ko'
7 ELSE 'Maybe'
8 END
9END AS my_result
10FROM table_name;
1SELECT *
2FROM suppliers
3WHERE (state = 'California' AND supplier_id <> 900)
4OR (supplier_id = 100);
1SELECT items.* FROM items i, meta_data m1, meta_data m2
2 WHERE i.item_id = m1.item_id and i.item_id = m2.item_id
3 AND m1.meta_key = 'lat' AND m1.meta_value >= 55 AND m1.meta_value <= 65
4 AND m2.meta_key = 'lng' AND m2.meta_value >= 20 AND m2.meta_value <= 30
1SQL> SELECT ID, NAME, SALARY
2FROM CUSTOMERS
3WHERE SALARY > 2000 OR age < 25;
1+----+----------+----------+
2| ID | NAME | SALARY |
3+----+----------+----------+
4| 3 | kaushik | 2000.00 |
5| 4 | Chaitali | 6500.00 |
6| 5 | Hardik | 8500.00 |
7| 6 | Komal | 4500.00 |
8| 7 | Muffy | 10000.00 |
9+----+----------+----------+
10