Mysql-What does this query mean?

2019-09-12 13:27发布

I'm trying to understand some queries

one of them is

(select (@a) 
 from (select(@a:=0x00)
     ,(select (@a) 
       from (information_schema.schemata)
       where (@a) in (@a:=concat(@a,schema_name,'<br>'))
       )
 ) a
)

Can some explain it please?

标签: mysql mysqli
1条回答
仙女界的扛把子
2楼-- · 2019-09-12 13:44

Not much to explain, it is a horrendous abuse of session variables. It looks like it is trying to get a concatenated list of database names, in the same manner GROUP_CONCAT would with a delimiter of <br>; but it looks very unreliable.

查看更多
登录 后发表回答