Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> MySQL

Cách lấy thông tin chi tiết cột bảng MySQL hơn SHOW COLUMNS

Nếu muốn lấy thông tin chi tiết hơn về các cột của bảng hiện có, hãy dùng câu lệnh SHOW FULL COLUMNS. Ví dụ áp dụng trên bảng Employee:

mysql> SHOW FULL COLUMNS FROM EMPLOYEE\G
*************************** 1. row ***************************
Field: Id
Type: int(11)
Collation: NULL
Null: YES
Key: 
Default: NULL
Extra: 
Privileges: select,insert,update,references
Comment: 
*************************** 2. row ***************************
Field: Name
Type: varchar(20)
Collation: latin1_swedish_ci
Null: YES
Key: 
Default: NULL
Extra: 
Privileges: select,insert,update,references
Comment: 
2 rows in set (0.13 sec)

Kết quả bổ sung thêm các cột: Collation, Privileges, Comment so với SHOW COLUMNS thông thường.