Databases Reference
In-Depth Information
When we execute the query using the
SELECT
COUNT(1)
statement, we obtain the same
execution plan—there is no difference in execution plans, as the database does the same
work to answer both queries. Hence, they are equivalent—the myth
SELECT(1)
is faster
than
SELECT(*)
is wrong—they are the same query.
In step 8, we execute a query to retrieve, for each distinct credit limit value, the maximum
year of birth of the corresponding customers; we want to retrieve only customers with a
credit limit of more than 10000.