What is better SELECT * or SELECT field names
What is better to use when retrieving all the fields from a table when making a query along one of the following lines
SELECT * FROM Customer WHERE CustomerID = 4
SELECT * FROM Accounts WHERE AccountID = 100 AND Customer ID = 4
What is better individually listing each field name in the query or using *. What is more faster and more efficient. Thanks for your help
Re: What is better SELECT * or SELECT field names
I would take * because it is made for it.
Re: What is better SELECT * or SELECT field names
It makes virtually no difference, because the SQL gets expanded from "SELECT *" to "SELECT [Field1], [Field2], etc." before the database engine is queried.
The only overhead is when the SQL is initially parsed and for most cases this will be negligable.