Mysql 獲取表的所有字段


select COLUMN_NAME from information_schema.COLUMNS where table_name = 'your_table_name';

select COLUMN_NAME from information_schema.COLUMNS where table_name = 'your_table_name' and table_schema = 'your_db_name';

取出所有字段,用一行顯示(中間用英文逗號隔開)
select group_concat(COLUMN_NAME SEPARATOR ',')  from information_schema.COLUMNS where table_name = 'tableName';


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM