本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
列出資料庫並搜尋指定的資料庫
本節中的範例顯示如何依結構描述名稱列出中繼資料中的資料庫。
範例 – 列出資料庫
以下範例查詢會列出 information_schema.schemata 資料表中的數據庫。
SELECT schema_name FROM information_schema.schemata LIMIT 10;
下列資料表會顯示範例結果。
| 6 | alb-databas1 |
| 7 | alb_original_cust |
| 8 | alblogsdatabase |
| 9 | athena_db_test |
| 10 | athena_ddl_db |
範例 – 搜尋指定資料庫
在下列範例查詢中,rdspostgresql 是範例資料庫。
SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'rdspostgresql'
下列資料表會顯示範例結果。
| schema_name | |
|---|---|
| 1 | rdspostgresql |