I need to convert a MySql query with subqueries to “chained query” format for Joomla. First of all: I am aware that the query can be rewritten without subqueries, but as a matter of performance I cannot avoid using them. So, the query is this:
SELECT `nome_doc` FROM ( SELECT `id_esameweb`, `nome_doc` FROM `referti_doc` WHERE `id_esameweb` = 100 AND `id` = 1 ) `d` INNER JOIN ( SELECT `id_esameweb` FROM `referti_esami` WHERE `id_paziente` = 1000 ) `e` ON (`e`.`id_esameweb` = `d`.`id_esameweb`); How can I chaining this type of MySql query?
Thanks in advance