Find the number of columns in a table

前端 未结 19 2244
Happy的楠姐
Happy的楠姐 2020-11-27 11:13

It is possible to find the number of rows in a table:

select count(*) from tablename

Is it possible to find the number of columns in a tabl

19条回答
  •  醉梦人生
    2020-11-27 12:06

    SELECT COUNT(*)
      FROM INFORMATION_SCHEMA.COLUMNS
     WHERE table_catalog = 'database_name' -- the database
       AND table_name = 'table_name'
    

提交回复
热议问题