SELECT company_relationship_history.* FROM company_relationship_history JOIN companies_relationship cr ON company_relationship_history.idcompany_relationship = cr.idcompany_relationship JOIN companies cFrom ON cr.from_idcompany = cFrom.idcompany JOIN companies cTo ON cr.to_idcompany = cTo.idcompany WHERE company_relationship_history.idcompany_relationship = :idcompany_relationship AND company_relationship_history.field = "status" ORDER BY FIELD(company_relationship_history.member,(CASE WHEN cFrom.idcompanytype IN (:id_retailers) THEN "from" ELSE "to" END), (CASE WHEN cFrom.idcompanytype IN (:id_retailers) THEN "to" ELSE "from" END)), company_relationship_history.history_date DESC
Hello, when I run this query :
SELECT company_relationship_history.* FROM company_relationship_history JOIN companies_relationship cr ON company_relationship_history.idcompany_relationship = cr.idcompany_relationship JOIN companies cFrom ON cr.from_idcompany = cFrom.idcompany JOIN companies cTo ON cr.to_idcompany = cTo.idcompany WHERE company_relationship_history.idcompany_relationship = :idcompany_relationship AND company_relationship_history.field = "status" ORDER BY FIELD(company_relationship_history.member,(CASE WHEN cFrom.idcompanytype IN (:id_retailers) THEN "from" ELSE "to" END), (CASE WHEN cFrom.idcompanytype IN (:id_retailers) THEN "to" ELSE "from" END)), company_relationship_history.history_date DESC
I got this error :
MESSAGE | PHPSQLParser\exceptions\UnableToCreateSQLException:unknown [expr_type] = in-list in "expression subtree" [4] LINE: 119 FUNCTION: PHPSQLParser\builders\SubTreeBuilder->build() FILE: /var/www/html/vendor/greenlion/php-sql-parser/src/PHPSQLParser/builders/SubTreeBuilder.php