回答編集履歴
2
変更
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
|
-
|
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
変更
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
|