Answers for "sql query with multiple where conditions"

SQL
26

sql if statement in where clause multiple values

SELECT CASE col1
	WHEN 'agree' THEN 'Ok'
	WHEN 'disagree' THEN 'Ko'
    ELSE
        CASE 
            WHEN col2 >= 1 THEN 'Ko'
            ELSE 'Maybe'
        END
END AS my_result
FROM table_name;
Posted by: Guest on July-04-2021
4

where sql multiple conditions

SELECT *
FROM suppliers
WHERE (state = 'California' AND supplier_id <> 900)
OR (supplier_id = 100);
Posted by: Guest on November-20-2020
2

sql select from multiple tables with conditions

-- b.VALUE1 is null when ID not in table2
-- LEFT OUTER JOIN is equivalent to LEFT JOIN
SELECT a.ID, a.NAME, b.VALUE1 FROM1 table1 a 
LEFT OUTER JOIN table2 b
ON a.ID = b.ID
WHERE a.ID >= 1000;
-- ⇓ Test it ⇓ (Fiddle source link)
Posted by: Guest on July-08-2021
5

multiple where statements sql

SELECT items.* FROM items i, meta_data m1, meta_data m2
    WHERE i.item_id = m1.item_id and i.item_id = m2.item_id
    AND m1.meta_key = 'lat' AND m1.meta_value >= 55 AND m1.meta_value <= 65
    AND m2.meta_key = 'lng' AND m2.meta_value >= 20 AND m2.meta_value <= 30
Posted by: Guest on May-03-2020
1

sql query with multiple where conditions

SQL> SELECT ID, NAME, SALARY 
FROM CUSTOMERS
WHERE SALARY > 2000 OR age < 25;
Posted by: Guest on November-20-2020
-2

sql query with multiple where conditions

+----+----------+----------+
| ID | NAME     | SALARY   |
+----+----------+----------+
|  3 | kaushik  |  2000.00 |
|  4 | Chaitali |  6500.00 |
|  5 | Hardik   |  8500.00 |
|  6 | Komal    |  4500.00 |
|  7 | Muffy    | 10000.00 |
+----+----------+----------+
Posted by: Guest on November-20-2020

Code answers related to "sql query with multiple where conditions"

Code answers related to "SQL"

Browse Popular Code Answers by Language