Hello,
I am running two GEMs and collecting data using standalone dashboard.
For one GEM, I retrieved data by using "SELECT * FROM `minutedata` WHERE channel_id=x;" query in phpMyAdmin.
However, how can I separate each GEM's data from the same table?
I can find only one `minutedata` table in `dashboard` database. There is `devices` table, but no foreign key was found in `minutedata` from the `devices` table.
I think I can add foreign key on database, but I guess the data is already separated because when I looked at the line graph in each GEM, the two GEM's data are separated.
Thanks for the answers!
multiple GEM identifier in standalone dashboard
-
- Posts: 8
- Joined: Thu Jun 15, 2017 8:51 am
multiple GEM identifier in standalone dashboard
- Attachments
-
- erd.png (259.95 KiB) Viewed 1590 times
-
- Site Admin
- Posts: 4266
- Joined: Fri Jun 04, 2010 9:39 am
Re: multiple GEM identifier in standalone dashboard
ecosang wrote:Hello,
I am running two GEMs and collecting data using standalone dashboard.
For one GEM, I retrieved data by using "SELECT * FROM `minutedata` WHERE channel_id=x;" query in phpMyAdmin.
However, how can I separate each GEM's data from the same table?
I can find only one `minutedata` table in `dashboard` database. There is `devices` table, but no foreign key was found in `minutedata` from the `devices` table.
I think I can add foreign key on database, but I guess the data is already separated because when I looked at the line graph in each GEM, the two GEM's data are separated.
Thanks for the answers!
This will give you all channels that belong to one GEM (replace X's with Serial).
Code: Select all
SELECT * FROM channel
INNER JOIN devices.device_id = channel.device_id
WHERE serial = XXXXXXX;
Code: Select all
SELECT * FROM minutedata
INNER JOIN channel ON channel.channel_id = minutedata.channel_id
INNER JOIN devices.device_id ON devices.device_id = channel.channel_id
WHERE serial = XXXXXXX
AND date BETWEEN 'START' AND 'END';
Ben
Brultech Research Inc.
E: ben(at)brultech.com
Brultech Research Inc.
E: ben(at)brultech.com