Mysql-What does this query mean?

孤者浪人 提交于 2020-02-08 03:15:26

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38704555/mysql-what-does-this-query-mean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!