To get total number of columns in a table in sql

后端 未结 9 1320
清酒与你
清酒与你 2021-01-30 13:05

I need a query in sql to get total columns in a table.Can anybody help?

9条回答
  •  孤城傲影
    2021-01-30 13:17

    It can be done using:-

    SELECT COUNT(COLUMN_NAME) 'NO OF COLUMN' FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'Address'
    

提交回复
热议问题