I agree entirely with the below (posted as a comment on said link):
Quote:
Frankly, the only time someone should be selecting * is for some adhoc data discovery; in which case, the inclusion of some extraneous columns shouldn't matter.
Production level code should explicitly list the columns to be returned. The principal reason for this is to insure against schema changes. When a field is added to a table, select * will return it -- sometimes with unexpected results.
With the myriad of IDEs available for database developers, including the entire list of columns should not be a burden
|
However, i also noted another comment discussing views. If you really are continuously looking up data to check it, but want to omit your particular columns (large blob/text columns are a good example) then CREATE A VIEW with the specified columns you do want, then do SELECT * FROM <VIEW>
Code:
CREATE VIEW 'view_name' AS SELECT column1,column2,column3 FROM <table>;
SELECT * FROM view_name;