有没有大佬知道Mysql 查询结果如何转成json字符串输出? 255
展开全部
用sql还真的可以,大概是这样:
explain format=json select * from users where userid=1\G
下面是这个语句的语法要求:
MySQL数据库:5.7.20-log MySQL Community Server (GPL)
名词:
QEP: Query Execution Plan,查询执行计划。
语法:
EXPLAIN [explain_type] {explainable_stmt }
explain_type:
{ EXTENDED | PARTITIONS | FORMAT = format_name}
format_name:
{ TRADITIONAL | JSON}
explainable_stmt:
{ SELECT statement | DELETE statement | INSERT statement | REPLACE statement | UPDATE statement }
explain format=json select * from users where userid=1\G
下面是这个语句的语法要求:
MySQL数据库:5.7.20-log MySQL Community Server (GPL)
名词:
QEP: Query Execution Plan,查询执行计划。
语法:
EXPLAIN [explain_type] {explainable_stmt }
explain_type:
{ EXTENDED | PARTITIONS | FORMAT = format_name}
format_name:
{ TRADITIONAL | JSON}
explainable_stmt:
{ SELECT statement | DELETE statement | INSERT statement | REPLACE statement | UPDATE statement }
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询