简体   繁体   中英

retrieve all column names in sql

I want to see all the column names in my db2 table. I cannot find a viable solution that works online.

I tried this:

select * from MEASUREMENTS

as well as:

select * from syscat.columns where tabname = 'MEASUREMENTS'

but didn't return what I needed.

how can i do this?

So I made a mistake, the query I was using did in fact work. I jsut needed to send it to the screen to see all the results because my console kept cutting it off.

the query was:

select * from syscat.columns where tabname = 'MEASUREMENTS'

and the returned column name variable is colname

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM