Home > database > Online waiting for a SQL and high speed
Online waiting for a SQL and high speed
Time:10-14
-- -- -- -- -- -- -- -- -- -- table 1 -- -- -- -- -- -- -- Id cname 1 USDT 2 the ETH 3 EOS 4 HC 5 USDX 6 QTUM
-- -- -- -- -- -- -- -- -- -- table 2 -- -- -- -- -- -- -- -- -- Id name cids 1 A, 1, 2, 3 2 B 1 3 C 4 D
-- -- -- -- -- -- -- -- -- for the -- -- -- -- -- -- -- -- -- -- 1 A USDT, ETH, EOS 2 B USDT 3 C 4 D
CodePudding user response:
Select Id, b.n ame, group_concat ((select a.c name from a where id=substring_index (substring_index (biggest ids, ', ' , bb. Help_topic_id + 1), ', ', 1))) The from B The join Mysql. Help_topic bb On bb. Help_topic_id & lt; (the length (the biggest ids) - length (the replace (biggest ids, ', ', ')) + 1) group by id