Good day! Help to make a request to the database mysql. Given table:
|id|haracterictic_id| value |modification_id| --------------------------------------------- |1 | 40 | Седан | 122 | |2 | 40 | Пикап | 123 | |3 | 39 |Автомат| 122 |
You need to make a request so that it haracterictic_id
for the fields haracterictic_id
and modification_id
and haracterictic_id
exact value, for example:
you need to find the value of the modification_id
field, if you know that haracterictic_id
will be '40' and '39', and value
will be 'Sedan' and 'Automatic', respectively
...WHERE modification_id IN (39, 40) AND value IN ('Седан', 'Автомат')
? The conditionfield IN (val1, val2...)
can be described as(field = val1 or field = val2)
, then your condition takes the form...WHERE (modification_id = 39 OR modification_id = 40) AND (value = 'Седан' OR value = 'Автомат')
- BOPOH