posted 10 years ago
Don't do "SELECT * FROM customer".
It's quite rare that you really need every column from every record in a given table for a DB application, and fetching unnecessary data just adds extra work and uses up bandwidth. Select specific columns, and only for the records you want i.e. use a WHERE clause wherever possible.
Another problem with "SELECT * ..." is that the table structure may change. Columns may be added/removed from the table, or the column names/data types might change, but there's nothing in your SQL statement to tell the next programmer whether they need to change your SQL to take account of these changes. Make your intentions for your SQL query explicit - select specific columns by name - so that maintaining the program is easier when (not if) the DB changes.
No more Blub for me, thank you, Vicar.