teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

変更

2017/06/21 06:35

投稿

A.Ichi
A.Ichi

スコア4070

answer CHANGED
@@ -3,7 +3,7 @@
3
3
  SELECT t1.`contentsCode`,SUM(`dayAccess`) AS 'totalAccess'
4
4
  ,`title`
5
5
  FROM `contentsLogSumallyTable` AS t1
6
- LEFT JOIN `contentsTable` AS t2 ON t1.`contentsCode` = t2.`contentsCode` AND `index` = 'yes'
6
+ JOIN `contentsTable` AS t2 ON t1.`contentsCode` = t2.`contentsCode` AND `index` = 'yes'
7
7
  WHERE logDate BETWEEN :startDate AND :endDate
8
8
  GROUP BY t1.`contentsCode`
9
9
  ORDER BY `totalAccess` DESC;

1

変更

2017/06/21 06:35

投稿

A.Ichi
A.Ichi

スコア4070

answer CHANGED
@@ -1,7 +1,7 @@
1
1
  こんな感じでしょうか
2
2
  ```sql
3
3
  SELECT t1.`contentsCode`,SUM(`dayAccess`) AS 'totalAccess'
4
- ,title
4
+ ,`title`
5
5
  FROM `contentsLogSumallyTable` AS t1
6
6
  LEFT JOIN `contentsTable` AS t2 ON t1.`contentsCode` = t2.`contentsCode` AND `index` = 'yes'
7
7
  WHERE logDate BETWEEN :startDate AND :endDate