How can I make such a request, for example? in MySQL
SELECT * FROM Table t
WHERE t.a IN (1,2,3)
AND t.b IN (4,5,6)
AND t.c IN (7,8,9) ...
so that the result contains only three lines:
t.a|t.b|t.c
---+---+---
1 | 4 | 7
2 | 5 | 8
3 | 6 | 9
The above query, of course, returns all combinations of values ββin IN clauses, but I would like to get only those that match the first elements of each tuple, secondly, the elements of each match, etc. .
Is there an effective way to do this?
By the way, is there a general term for this kind of query or concept? Itβs not easy for me to come up with the name of the question because I cannot say it in words.
Janne source
share