Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grafana inner join many to one between 2 database

Tags:

grafana

I am using Mixed data sources

I used two postgres databases, created two queries

In transform section, used Join by field => Mode as Inner join. But it is returning only one row instead of many-to-many join

Query1 result

user_id, name
1,abc
2,def

Query2 result

order_id,user_id
1,1
2,1

Transform result

user_id,order_id,name
1,2,abc

Expected transform result

user_id,order_id,name
1,1,abc
1,2,abc

Is many-to-many or many-to-one join not possible in Grafana?

Thanks in advance!

like image 944
Yusuf Avatar asked Oct 14 '25 09:10

Yusuf


1 Answers

I'm afraid this is not supported.

My understanding is that field used in join expected to be unique within every query result.

Since joins are more of RDBMS task I would suggest investigate possibility of using Postgres to its fullest. Looking into dblinks, this way you'll get native sql joining capabilities.

like image 147
markalex Avatar answered Oct 17 '25 16:10

markalex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!