hi there, hope in your help.
- if tried the query #1 I have for output 22 rows in set
- if tried the query #2 I have for output 16 rows in set
Why?
Where does the row with output null ?
thank you.
query #1
mysql> SELECT
ID,
output
FROM
tbl_0
WHERE
1
AND ID IN (
492,
852,
2713,
4159,
4498,
5258,
5477,
5594,
5760,
6404,
6419,
8305,
8816,
9863,
10363,
10401,
10448,
10449,
10450,
11138,
11201,
11301
);
+-------+--------+
| ID | output |
+-------+--------+
| 492 | |
| 852 | 01 |
| 2713 | 01 |
| 4159 | 01 |
| 4498 | |
| 5258 | 01 |
| 5477 | 01 |
| 5594 | 01 |
| 5760 | |
| 6404 | |
| 6419 | |
| 8305 | 01 |
| 8816 | 01 |
| 9863 | 01 |
| 10363 | 01 |
| 10401 | 01 |
| 10448 | 01 |
| 10449 | 01 |
| 10450 | 01 |
| 11138 | 01 |
| 11201 | 01 |
| 11301 | |
+-------+--------+
22 rows in set
query #2
mysql> SELECT
ID,
output
FROM
tbl_0
WHERE
FIND_IN_SET('01', output) > 0
OR FIND_IN_SET('02', output) > 0
OR FIND_IN_SET('03', output) > 0
OR FIND_IN_SET('04', output) > 0
OR FIND_IN_SET('', output) > 0
OR FIND_IN_SET(NULL, output) > 0
OR ISNULL(output)
OR output IS NULL
ORDER BY
ID ASC;
+-------+--------+
| ID | output |
+-------+--------+
| 852 | 01 |
| 2713 | 01 |
| 4159 | 01 |
| 5258 | 01 |
| 5477 | 01 |
| 5594 | 01 |
| 8305 | 01 |
| 8816 | 01 |
| 9863 | 01 |
| 10363 | 01 |
| 10401 | 01 |
| 10448 | 01 |
| 10449 | 01 |
| 10450 | 01 |
| 11138 | 01 |
| 11201 | 01 |
+-------+--------+
16 rows in set