I have a query which has a list of values for checking against a single column in a multi column table.
Example query ONE......
SELECT `name`, `sleeps`
FROM `properties`
WHERE `town`='bude' OR `town`='newquay' OR `town`='widemouth' OR `town`='polzeath' OR `town`='crantock' OR `town`='perranporth' OR `town`='Porthmeor' OR `town`='St Ives' OR `town`='porthtowan'
Example query TWO......
SELECT `name`, `sleeps`
FROM `properties`
WHERE `town` IN ('bude', 'newquay', 'widemouth', 'polzeath', 'crantock', 'wadebridge', 'Porthmeor', 'St Ives', 'porthtowan')
-
-
I have run both in phpmyadmin and found the query speed to be very similar, all be it with a table of approx 5,000 records.
In terms of performance and durability when the table contains more data is is best to go for the 'IN' style query or use multiple instances OR?
Thanks