欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

mysql 查詢表,mysql數(shù)據(jù)庫如何快速獲得庫中無主鍵的表

傅智翔2年前42瀏覽0評論
mysql 查詢表,mysql數(shù)據(jù)庫如何快速獲得庫中無主鍵的表?

獲取數(shù)據(jù)庫中除系統(tǒng)庫之外所有無主鍵的表sql如下:

SELECT

table_schema,

table_name

FROM

information_schema. TABLES

WHERE

(table_schema, table_name) NOT IN (

SELECT DISTINCT

table_schema, table_name

FROM

information_schema. COLUMNS

WHERE

COLUMN_KEY = 'PRI'

)

AND table_schema NOT IN (

'sys',

'mysql',

'information_schema',

'performance_schema'

);