Jackson
Jackson

Reputation: 9

How to get the latest records of each column in TDengine database?

I got two columns for my regular table and I would like to know the latest record of each column, what SQL command should I use? The schema of the table is as follows:
enter image description here

Upvotes: -1

Views: 160

Answers (1)

Xiao Ping
Xiao Ping

Reputation: 301

you can try

select last(c1) from tbname

this query will retun the last non-null value of c1

or you can try

select last_row() from tbname

the query will return the last row of the table no matter the column is null or not

Upvotes: 0

Related Questions