From: Philip Reetz Date: Wed, 7 Dec 2005 09:40:13 +0000 (+0000) Subject: SQL-Query optimiert fuer raussuchen letzer Kunde X-Git-Tag: release-2.4.0^2~442 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a6476377c82786fa618f4d129ea7da5d33806da0;p=kivitendo-erp.git SQL-Query optimiert fuer raussuchen letzer Kunde --- diff --git a/SL/Form.pm b/SL/Form.pm index 5fb58aff2..a0fa96a2c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1765,10 +1765,9 @@ sub lastname_used { $where = "quotation = '1'"; } - my $query = qq|SELECT id FROM $arap - WHERE id IN (SELECT MAX(id) FROM $arap + my $query = qq|SELECT MAX(id) FROM $arap WHERE $where - AND ${table}_id > 0)|; + AND ${table}_id > 0|; my $sth = $dbh->prepare($query); $sth->execute || $self->dberror($query);