You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SUM ( CASE WHEN "vote_status"='0' THEN 1 ELSE 0 END ) AS star_num,
20
+
SUM ( CASE WHEN "vote_status"='1' THEN 1 ELSE 0 END ) AS trample_num,
21
+
SUM ( CASE WHEN array_length( application_chat_record.improve_paragraph_id_list, 1 ) IS NULL THEN 0 ELSE array_length( application_chat_record.improve_paragraph_id_list, 1 ) END ) AS mark_sum,
22
+
chat_id
23
+
FROM
24
+
application_chat_record
25
+
GROUP BY
26
+
application_chat_record.chat_id
27
+
) chat_record_temp ON application_chat."id"=chat_record_temp.chat_id
28
+
LEFT JOIN (
29
+
SELECT
30
+
*,
31
+
CASE
32
+
WHEN array_length( application_chat_record.improve_paragraph_id_list, 1 ) IS NULL THEN
33
+
'{}' ELSE ( SELECT ARRAY_AGG ( row_to_json ( paragraph ) ) FROM paragraph WHERE"id"= ANY ( application_chat_record.improve_paragraph_id_list ) )
0 commit comments