--- a/displayConsultancies.php +++ b/displayConsultancies.php @@ -11,8 +11,8 @@ include_header("Consultancies"); $query = ' -SELECT SUM(value) as value, count(*), min("supplierName"), unnest(string_to_array("consultancyReason",\';\')) reason -FROM contractnotice where "consultancy" = \'Yes\' +SELECT SUM(value) as value, count(*), text_mode("supplierName"), unnest(string_to_array("consultancyReason",\';\')) reason +FROM contractnotice where ' .$yearQ . ' "consultancy" = \'Yes\' and "childCN" is null GROUP BY "supplierABN",reason order by value desc ';