There is a table with fields: gorod , category

it is necessary to make a condition in the request so that, for example, entries from the city of moskva and from the categories avto and tehnika be output.

Now I do this:

 SELECT * FROM baza WHERE gorod = 'moskva' AND cat = 'avto' 

How can I add another condition so that the entries from the tehnika category are also displayed? If I put more AND cat = 'tehnika' , then of course it does not display anything.

    2 answers 2

     SELECT * FROM baza WHERE gorod = 'moskva' AND cat IN ('avto', 'tehnika') 

    or

     SELECT * FROM baza WHERE gorod = 'moskva' AND (cat = 'avto' OR cat = 'tehnika') 
    • Thank you very much, it works! - StopTussin

    SELECT * FROM baza WHERE gorod = 'moskva' AND (cat = 'avto' OR cat = 'tehnika');