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

后端 未结 12 1171
野的像风
野的像风 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:21

    In Sybase SQL Anywhere, the columns and table information are stored separately, so you need a join:

    select c.column_name from systabcol c 
           key join systab t on t.table_id=c.table_id 
           where t.table_name='tablename'
    

提交回复
热议问题