Replies: 1 comment 3 replies
-
group_concat 现在暂不支持 order by。。 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SQL:
select a.corp_id,GROUP_CONCAT(case when a.msg_from='12590' then '1' else '0' end,'') from (select * from ods_wechat_work_msg where msg_time between '2021-09-01' and '2021-09-24' and (msg_from='12590' and to_list='["wmX-IpBwAAdHj9jDaaR9skU1dkkNPcOg"]' or msg_from='wmX-IpBwAAdHj9jDaaR9skU1dkkNPcOg' and to_list='["12590"]') and (room_id is null or LENGTH(room_id)=0) order by msg_time) a group by a.corp_id;
查询结果:
011001101000011110011101011
011010111010111101010001001
101000100101101001111101110
011101000011001110111010110
010100111101010001110110011
010011100111011101101000101
010111101101000110100101101
101000111011101100101010110
111101010010111010001101001
101000010111110101101001011
011001100111101110101000011
每次查询结果都不一样,group_concat的排序规则是什么的呢
Beta Was this translation helpful? Give feedback.
All reactions