I was struggling to find a way to replace multiple JOIN with inner select in SQL command but nothing found up to now. I have a query which joins 11 tables and due to multiple roles I have to have 21 joins in my query. so I decided to find more information in my tables and found out I have a table which has proper information to relate some tables. [my result table ][1]
as you can see I have a field named "Mainuuid" which is relevant with different "Slave" values. Each slave value is primary key in it's relative table.
So what I need is a single row which is computed from multiple select based on the result image for example: I named the result table as "test"
- SELECT a,b FROM person WHERE Id=test.slave,
- SELECT x,y FROM Unit WHERE Id=test.slave,
SELECT o,p FROM naturalperson WHERE Id=test.slave
And I want to put all result in a single row! any suggestion will be appreciated.