Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Originally posted by: BKBK
I am ignoring cachedWithin because it seems to be redundant in your code. I am also assuming that myID is a key, and so is unique. Then one can combine Query One and Query Two thus
<cfquery name="uniqueQuery" dbtype="query">
SELECT *
FROM favorite_sites, notes_get
</cfquery>
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Originally posted by: efecto747
If notes and favorite_sites have no relation then trying to combine them into one query doesn't really seem to have much advantage. You could use a UNION query as Dan suggested which will certainly give you something along the lines of what you're after but it you'd have to consider what performance gain you might expect from such a move - I'd imagine the differences in performance would be almost non-existent.
Are you sure your performance is suffering because of the queries? Have you turned on debugging and looked at the total execution time of all queries? I'd be looking at other aspects of the page generation before trying to combine queries - especially if the data isn't related.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Originally posted by: Dan Bracuk
You say you want your results sorted but neither query has an order by clause.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
quote:
Originally posted by: CF_Oracle
To maintain sort order of first query in a second one uyou can use loop.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied