MySQL DB Query

I’m pulling data on a tag i’m taking history on from a database table and the query looks like this

SELECT *
FROM sqlth_te
WHERE tagpath = ‘a_name/goldtest7_7simulator/sensor {Root Container.Text Field.text}/sensor {Root Container.Text Field.text}/humidity’

I’m just looking to pull the data from a specific tag and I’m pretty sure that the query is correct. My question is more about where is the history stored for tags? My query is only returning one row. Any thoughts?

Use the scripting function system.tag.queryTagHistory(). Querying the tag history database directly is not as easy as one would think.

Thank you! That looks much easier! In addition to that, I also just discovered/rediscovered that there is a tag history option under property bindings, so I think I may be able to use that as well!