http://www.perlmonks.org?node_id=272377


in reply to Re: Code factory
in thread Code factory

A note on select *. In some db's, you can do subselects with select * that increase maintainability. You can get things like:
select drink.id, drink.name from ( select * from beverage where type = ? ) drink
now mind you, it may not be as efficient as explicitly doign every single column, but if the sub query produces negligible data-size difference (in bytes) then you can definitely get away w/ it and have virtually no performance difference.

Granted, this query can be rewritten so that it doesn't use a subquery, but subqueries are a feature that is needed sometimes. This is just merely an example showing only the features of a subselect and select * :)