1. 程式人生 > >資料庫SQL實踐49:針對庫中的所有表生成select count(*)對應的SQL語句

資料庫SQL實踐49:針對庫中的所有表生成select count(*)對應的SQL語句

思路:

列出資料庫中所有表名:

select name from sqlite_master where type='table'

用||連線

"select count(*) from" || name || ";"從而實現連線

select "select count(*) from " || name || ";" as cnts
from sqlite_master where type = 'table';

學習啦