現在、ここでの私のコードはそのような結果を生み出します:
SELECT YEAR(date_added) AS YEAR, MONTHNAME(date_added) AS MONTH, COUNT(*) AS TOTAL
FROM news
GROUP BY MONTH
UNION ALL
SELECT YEAR(date_added) AS YEAR, MONTHNAME(date_added) AS MONTH , COUNT(*) AS TOTAL
FROM equipment
GROUP BY MONTH
RESULTS:
YEAR MONTH TOTAL
2013 FEB 1 (news table)
2013 JAN 12 (news table)
2013 FEB 1 (equipment table)
2013 JAN 11 (equipment table)
以下のみを表示できるようにSQLクエリを編集するにはどうすればよいですか。
RESULTS: YEAR MONTH TOTAL 2013 FEB 2 (both news and equipment table) 2013 JAN 23 (both news and equipment table)
助けてくれてありがとう!