Define your complex SQL query. When implementing your complex query do not use global $wpdb; in your methods. Use ::getWpdb() instead.
A complex query can be splitted into three parts:
** File not found : $rows **
This function is called when procedures (stored functions and procedures) are available. It is also necessary that mysqli is in use. mysql_connect does not support store_results() method. This method should return your expected result. You should work with this::hasProcedure() to install your procedure if not exists.
A procedure can for example write into a temporary table and reads from it again.
getProcedureResults(string $sql,boolean $returnTrue = false): Array
Call a "CALL proc" SQL and parse the results.
The SQL string to execute
When the CALL is successfully and has no results then return true instead of an empty array
or false when an error occur