i need some help with select statement.
table: mobiles (brand,model,price)
i tried the below syntax to fetch the content.
select *
from mobiles
where brand in ('apple','nokia','samsung')
and model in ('lumia 510','galaxy s3')
the above query is showing only "nokia lumia 510" and "samsung galaxy s3".
i want it to display all models in 'apple', only 'lumia 510' from 'nokia' and 'galaxy s3' from 'samsung'.
am i wrong at using the syntax?
i am developing a site where users can filter mobiles by brand and model. i need to display only the mobiles what user's select. for each brand if the user select's specific model, then, only that model should be displayed, if he selects only the brand then all the mobiles under that brand should be displayed.
he can choose any number of brands, and under each brand he might or might not select the specific model.