Reputation: 164
I am New to sql
I have Select boxes on my page when a user selects from that boxes and click submit all of the info will be pulled from a single table with the given multiple select boxes values is it possible to put multiple values in WHERE
Regards'Sajid
Upvotes: 0
Views: 1332
Reputation: 911
You can have a query like this (example):
SELECT * FROM myTable
WHERE price < 80
AND price > 30
AND comments IS NOT NULL
AND category = 'snacks'
AND ...
Upvotes: 0
Reputation: 45912
You will need an IN
operator:
SELECT *
FROM `table_name`
WHERE `column_name` IN (1, 2, 3, 4, 5) -- comma separated list of values
Upvotes: 1