Problem: I am trying to optimize the following into one query.
Desired Result: If both queries return at least 1 row, output True or 1. If only one query returns a result, output false or 0. Any help is appreciated!
SELECT item_id
FROM `category_item`
WHERE `category_id` =39610 AND `item_id` = 31
SELECT item_id
FROM `category_item`
WHERE `category_id` =37 AND `item_id` = 31
you can add == 2 or > 1 for that matter
EDIT:
just to clarify:
will result in return 1 or 0