I have a simple database schema (Timescaledb) with a few tables. Each user has one main sensor with multiple metrics, each metric has its own table with user_id and timestamp.
Schema
Table 1
| user_id | timestamp | val1 | val... |:---- |:------:| -----:| -----: Table ...
user_id | timestamp | val1 | val... |
---|
Question
I want to know how can I merge these tables in a view with the time_bucket
function. So, if I sample it every 10 seconds to show something like
View
user_id | timestamp | agg val from table 1 | agg val from table 2 | agg val from table X |
---|