1.查詢數(shù)據(jù)庫所有表信息:
select t.table_name, t.table_comment
from information_schema.tables t
where table_schema='t6_660' and table_type='base table';
2.查詢數(shù)據(jù)庫所有表字段結(jié)構(gòu):
select column_name,
column_type,
data_type,
character_maximum_length,
is_nullable,
column_default,
column_comment
from information_schema.columns
where table_schema ='t6_660' and table_name = #{tablename}
3.查詢數(shù)據(jù)庫所有視圖定義:
SELECT
table_name,
view_definition,
is_updatable
FROM information_schema.views
where table_schema='t6_660'
4.mysql常用函數(shù):
# NULL值判斷,默認(rèn)值(NVL)
select ifnull(null,0) from dual;
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者