What is the SQL command to return the field names of a table?

后端 未结 12 1215
野的像风
野的像风 2020-12-05 07:03

Say I have a table called myTable. What is the SQL command to return all of the field names of this table? If the answer is database specific then I need SQL Server right

12条回答
  •  悲&欢浪女
    2020-12-05 07:28

    For IBM DB2 (will double check this on Monday to be sure.)

    SELECT TABNAME,COLNAME from SYSCAT.COLUMNS where TABNAME='MYTABLE'
    

提交回复
热议问题