P
P
Pepper12019-07-18 12:05:47
SQL
Pepper1, 2019-07-18 12:05:47

How to make an sql query for several matches in different fields of the same table?

How to make an sql query for several matches in different fields of the same table? we have 5 fields of the table, we need to make a selection if some SEVERAL values ​​match

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2019-07-18
@AUser0

SELECT * FROM `table` WHERE
      `field1` IN ('1', '2', '3')
      AND `field2` IN (6, 7, 8)
      AND 'field3' IN ('000-888')
      AND `field4` IN ('mama', 'papa', 'baba')
      AND 'field5' IN ('yes', 'ok', 'on')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question