質問編集履歴
3
|送信者 受信者 間違え修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|:--|:--:|--:|--:||--:|
|
8
8
|
|
9
|
-
|ユニーク(インクリメント)|受信者ID|送信者ID|
|
9
|
+
|ユニーク(インクリメント)|受信者ID|送信者ID|受信者フラグ|送信者フラグ|送信日時|
|
10
10
|
|
11
11
|
|
12
12
|
|
2
コピペでいらない文字が含まれていたため。
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,11 +76,11 @@
|
|
76
76
|
|
77
77
|
SELECT MAX(id) AS max_id,
|
78
78
|
|
79
|
-
(CASE WHEN (from_user_id
|
79
|
+
(CASE WHEN (from_user_id < to_user_id)
|
80
80
|
|
81
|
-
THEN CONCAT(from_user_id, to_user_id
|
81
|
+
THEN CONCAT(from_user_id, to_user_id)
|
82
82
|
|
83
|
-
ELSE CONCAT(to_user_id
|
83
|
+
ELSE CONCAT(to_user_id, from_user_id)
|
84
84
|
|
85
85
|
END) AS ROOMID,
|
86
86
|
|
@@ -98,9 +98,9 @@
|
|
98
98
|
|
99
99
|
FROM mail_data
|
100
100
|
|
101
|
-
WHERE (to_user_
|
101
|
+
WHERE (to_user_id = 「ユーザID」 OR from_user_id = 「ユーザID」)
|
102
102
|
|
103
|
-
AND
|
103
|
+
AND to_user_flg != 0
|
104
104
|
|
105
105
|
GROUP BY ROOMID ORDER BY SORT ASC, max_id DESC
|
106
106
|
|
1
DESCが抜けていたため。
test
CHANGED
File without changes
|
test
CHANGED
@@ -102,7 +102,7 @@
|
|
102
102
|
|
103
103
|
AND mail_data.jushinn_op_flg != 0
|
104
104
|
|
105
|
-
GROUP BY ROOMID ORDER BY SORT ASC, max_id
|
105
|
+
GROUP BY ROOMID ORDER BY SORT ASC, max_id DESC
|
106
106
|
|
107
107
|
|
108
108
|
|