sbains
December 21, 2017, 4:27pm
1
Hi All,
Is there an option to find the time stamp when new tag value is inserted into the database. E.g. Using the below query I can view the “TAG” values
show tag values from with key = “TAGName” where
The output gives me the TAG Values but wondering if there is an option to view the timestamps associated with first tag entry?
katy
February 8, 2018, 5:51pm
2
Can you be more specific about what you’re querying?
In a simple WHERE clause, the timestamps are returned.
For example, selecting data with specific tag key-values:
SELECT “water_level”
FROM “h2o_feet”
WHERE “location” = ‘santa_monica’
name: h2o_feet
time water_level
2015-08-18T00:00:00Z 2.064
2015-08-18T00:06:00Z 2.116
[…]
2015-09-18T21:36:00Z 5.066
2015-09-18T21:42:00Z 4.938
Are you looking to get just the timestamp of the first entry?
sbains
February 12, 2018, 5:55pm
3
Thanks Katy for the reply,
I’m looking for a query which can get me the following
Tag key-value
When the tag with the key-value was created (or first seen in the system)
katy
March 6, 2018, 5:35pm
4
Okay, I think I understand now.
SHOW TAG VALUE WITH KEY = "abc"
is something we call a meta query . Unlike regular queries it doesn’t actually query the data that we have stored with timestamps
There are a whole bunch of them, and they (almost exclusively) only talk to the index, which doesn’t contain timestamp information.
I don’t think we currently support returning timestamps on meta queries.
You can check out the docs on meta queries for a little more detail.
how about use subquery? instead of show tag values
like this
# show tag values from with key = “TAGName” where condition
select TagName from (select field, TagName from Measurement where condition)
it return timestamp with tag values