Retrieve sequence of data from different columns.
Posted
by janetsmith
on Stack Overflow
See other posts from Stack Overflow
or by janetsmith
Published on 2010-04-07T00:02:59Z
Indexed on
2010/04/07
0:13 UTC
Read the original article
Hit count: 639
Let's say I have a table containing following data:
| id | t0 | t1 | t2 |
| 1 | 4 | 5 | 6 |
| 2 | 3 | 3 | 2 |
| 3 | 6 | 4 | 5 |
| 4 | 4 | 5 | 5 |
I want to retrieve all the rows containing 4, 5, 6 (regardless the position of numbers in the tables), so row 1 & row 3 will be selected. How to do that with SQL query?
© Stack Overflow or respective owner