From b91bcdff200acb281c58c4ba5ef8482b335ecdbc Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 29 Oct 2007 10:30:53 +0000 Subject: mysql has no DISTINCT ON either, sigh --- httemplate/search/report_tax.cgi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'httemplate/search/report_tax.cgi') diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi index bb9c8f433..eddb3da00 100755 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -444,7 +444,20 @@ my %base_regions = (); foreach my $r ( qsearch( 'cust_main_county', {}, - "DISTINCT ON ( country, state, county, CASE WHEN taxname IS NULL THEN '' ELSE taxname END ) *", + "DISTINCT + country, + state, + county, + CASE WHEN taxname IS NULL THEN '' ELSE taxname END AS taxname,". + + #a little bit unsure of this part... test? + #ah, it looks like it winds up being irrelevant as ->{'tax'} + # from $regions is not displayed when show_taxclasses is on + ( $cgi->param('show_taxclasses') + ? " CASE WHEN taxclass IS NULL THEN '' ELSE taxclass END " + : " '' " + )." AS taxclass" + , $gotcust ) ) { -- cgit v1.2.1