4 ms·
SELECT * can be bad when you join other tables. For example: SELECT * FROM table1 JOIN table2 ON table2.field = table1.field In the above ex
by ohwp 13y ago
SELECT * can be bad when you join other tables.
For example:
SELECT
*
FROM table1
JOIN table2
ON table2.field = table1.field
In the above example you select everything from both table1 and table2. When they contain fields with the same name, strange things can happen.
Therefore always use: SELECT table1.* FROM table1