29.04.2017, 16:32
Adding a number to a column name is almost never a good idea. It usually signals poor database design.
If you want to select rows based on values in a list then you should the IN operator, e.g.
Or even
If you want to select rows based on values in a list then you should the IN operator, e.g.
PHP код:
SELECT * FROM table WHERE id IN(1, 3, 5, 7)
PHP код:
SELECT * FROM table WHERE someId IN(SELECT id FROM anotherTable WHERE foo = bar)