google spreadsheet - Get column headers with query language -
i'm using query language query data spreadsheet. retrieve first row(column headers), how do that?
currently i'm using: select * ( = -1 )
, data in column never equal -1, returns column headers.
is there straightforward way this?
you can use query(a:z, "select * limit 0", 1)
meaning: select all, return @ 0 rows. result header row returned (the 3rd parameter make clear there 1 header row).
but it's not natural use query
purpose. function array_constrain
provided purpose of truncating array of data. example,
=array_constrain(a:z, 1, 1e7)
returns first row of given array. (since no limit on number of columns needed, gave 1e7 = 10,000,000 maximal number of columns. spreadsheet can't have many cells.)
Comments
Post a Comment