标签:pre sql tables rgb get 数据 sql语句 一个 size
single.get("tablelist")
上述获取的是一个列表list
一种比较恶心的办法,将list以字符串的形式拼接在SQL语句中
if "共享平台" in single.get("key"): sql = "select " "table_schema, " "table_name, " "table_comment, " "round(data_length/1024/1024, 2) as ‘datasizeM‘, " "round(index_length/1024/1024, 2) as ‘indexsizeM‘, " "table_rows as ‘rows‘ " "from information_schema.tables " "where table_name in ("+str(single.get("tablelist")).split(‘[‘)[1].split(‘]‘)[0]+")" else:
如各位大侠有更好的办法,还请不吝赐教!
标签:pre sql tables rgb get 数据 sql语句 一个 size
原文地址:https://www.cnblogs.com/zhzhang/p/14506185.html