Merge two MySQL queries in to one?
Posted: Tue Nov 04, 2008 6:19 pm
I'm wondering if I can merge the following two MySQL queries in to a single query?
Result: 3
Result: thread_title thread_url
Example 3 example_3
Example 2 example_2
Example 1 example_1
Between yesterday and today I have finally gotten reasonably used to left joins. I'm wondering if I could merge these two however?
Code: Select all
SELECT tag_id FROM tags WHERE tag_name_base = '".$tag_name_base."'Code: Select all
SELECT thread_title, thread_url FROM xhref_tags LEFT JOIN threads ON xhref_thread_id = thread_id WHERE xhref_tag_id = '3'ORDER BY thread_title ASCExample 3 example_3
Example 2 example_2
Example 1 example_1
Between yesterday and today I have finally gotten reasonably used to left joins. I'm wondering if I could merge these two however?