回答編集履歴
1
追記
test
CHANGED
@@ -7,3 +7,19 @@
|
|
7
7
|
group byするときはselect句が*はありえないので
|
8
8
|
|
9
9
|
きちんと集計キーと集計方法を記載してください
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
# 追記
|
14
|
+
|
15
|
+
例示のデータを利用するとこうかな?
|
16
|
+
|
17
|
+
```SQL
|
18
|
+
|
19
|
+
select * from chat inner join
|
20
|
+
|
21
|
+
(select chat_id,max(updated_date) as updated_date from chat_messa group by chat_id) as sub
|
22
|
+
|
23
|
+
on chat.id=sub.chat_id order by id desc;
|
24
|
+
|
25
|
+
```
|