Are you saying that you have connected to a SQL database through grafana, but you can only query on of those? If so, you can add a second datasource of the same kind (say, MySQL) and then add two queries to the panel. After that, you could try merging the two tables using a transformation like the merge transform.
But maybe I misunderstand?
I would also search this forum for similar questions: