Newest or oldest insertion

Hey

How can i find newest or oldest insertion on influxdb?

Thanks,

@Indeed_1 We have some functions to help out with that. Please at least try to look at the documentation before posting here.

1 Like

@jackzampolin Would you please write an example , I’ve read all document before post something here but neither I don’t understand it or it’s vague!

Thanks,

@Indeed_1 The first and last functions are what you are looking for

select last(*) from cpu where time > now() - 1m
select first(*) from cpu where time > now() - 1m