首頁  >  文章  >  資料庫  >  檢查MySQL表列的字元集的查詢是什麼?

檢查MySQL表列的字元集的查詢是什麼?

WBOY
WBOY轉載
2023-09-22 08:05:28691瀏覽

檢查MySQL表列的字元集的查詢是什麼?

以下是檢查MySQL 表列的字元集的查詢-

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM
       information_schema.columns where table_schema = 'db_name' and
       table_name ='table_name';

範例

#例如,下面的查詢傳回名為「sample」的資料庫中「test_char_set」表的列名稱以及這些列的字元集。

mysql> Select Column_name 'Column', Character_set_name 'Charset' FROM
       information_schema.columns where table_schema = 'Sample' and
       table_name ='test_char_set';

+--------+---------+
| Column | Charset |
+--------+---------+
| Name   | latin1  |
| Field  | latin1  |
+--------+---------+
2 rows in set (0.03 sec)

以上是檢查MySQL表列的字元集的查詢是什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除