How do you join the results of 2 queries, ordering by date?
SELECT * FROM table1 WHERE tag='1'
SELECT * FROM table2 WHERE tag='3'
table1,table2 have the same fields:
id|article|author|tag|date
PS: BY THE WAY, tag IS workid
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
UNION ALLto get rows from both tables:You may also want to consider restructuring your database so that instead of using two tables you use just a single table with a field to distinguish the type of each row. Then the query can simplify to: