Is Query of Queries faster than multiple WHERE criteria?
If I need a recordset based on two table column fields (let's say firstName and lastName), is it better to run one query with a WHERE firstName = x AND lastName = y, or is it better to query of queries and find all records with a specified firstName, and then query that query to filter only records with a specified last name? Which is the better/faster method?
<cfquery name="somequery" datasource="someds">
SELECT *
FROM sometable
WHERE firstName = 'John' AND lastName = 'Smith'
</cfquery>
or....
<cfquery name="somequery" datasource="someds">
SELECT *
FROM sometable
WHERE firstName = 'John'
</cfquery>
<cfquery name="somequery2" dbtype="query">
SELECT *
FROM somequery
WHERE lastName = 'Smith'
</cfquery>
