From a5f30bf0b12c7e02f545f06215b4b10f01fa12d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Mon, 12 Dec 2005 15:55:58 +0000 Subject: [PATCH] Merge von 682 aus unstable: sql-performance SQL-Query optimiert fuer raussuchen letzer Kunde --- SL/Form.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- 2.20.1