一尘不染

如何计算表格中的列

mysql

例如 :

tbl_ifo

id | name  | age | gender 
----------------------------
1  | John  |  15 |  Male
2  | Maria |  18 |  Female
3  | Steph |  19 |  Female
4  | Jay   |  21 |  Male

如何使用mysql计数此表的列?


阅读 270

收藏
2020-05-17

共1个答案

一尘不染

SELECT count(*)
FROM information_schema.columns
WHERE table_name = 'tbl_ifo'
2020-05-17