Would anybody know the sql to enter here
$searchQueryBuilder->leftJoin( 'c', '`' . pSQL(_DB_PREFIX_) . 'customer`', 'pa', 'pa.`id_customer` = c.`id_customer` = ( SELECT pa2.`agecheck` FROM `'. pSQL(_DB_PREFIX_) .'customer` pa2 WHERE pa2.`id_customer` = pa.`id_customer` ORDER BY LENGTH(pa2.`agecheck`) DESC LIMIT 1 )' );
I need to get the column 'agecheck' from the 'ps_customer' table. The page this will be shown on is the orders list so doing a sql join from orders to customers.
And could somebody explain the format for the sql. ie, what 'c' & 'pa'/'pa2' are for. Then maybe I can work out the correct query for myself.
Thanks