In MySQL, the OR condition is used to filter the results obtained through the SELECT, INSERT, UPDATE and DELETE statements based on more than one conditions.
WHERE condition_1 OR condition_2 OR condition_3 …. OR condition_n;
condition_1, condition_2… condition_n: They are used to specify the conditions to be strictly followed for selection.
ID NAME QUANTITY 1 Electronics 30 2 Sports 45 3 Fashion 100 4 Grocery 90 5 Toys 50
SELECT * FROM items WHERE id = 2 OR id = 4;
ID NAME QUANTITY 2 Sports 45 4 Grocery 90 2 rows in set <0.01 sec>