Subject | Re: SQL and PLAN |
---|---|
Author | mivi71dk |
Post date | 2010-11-22T13:16:18Z |
Besides
Adding this
Select
transaktioner.Afdeling_ID as AfdNr,
sum (transaktioner.salgstk) as Antal,
sum (transaktioner.Salgkr) as Spr,
sum (transaktioner.KostPr) as Kpr
from transaktioner
INNER JOIN VARER ON TRANSAKTIONER.VAREFRVSTRNR = VARER.PLU_NR AND VARER.SERVICEYDELSE=0
where
transaktioner.art in (11) and
transaktioner.Dato>='2010-11-01 23:59:59'
and transaktioner.Dato<='2010-12-01 23:59:59'
group by
transaktioner.Afdeling_ID
third line in the where clauses also makes firebird pick what plan I like.
And - If my customer is not lying, this problem has comes forward the last few days, which means Firebird has started to guess another way tan before.
Adding this
Select
transaktioner.Afdeling_ID as AfdNr,
sum (transaktioner.salgstk) as Antal,
sum (transaktioner.Salgkr) as Spr,
sum (transaktioner.KostPr) as Kpr
from transaktioner
INNER JOIN VARER ON TRANSAKTIONER.VAREFRVSTRNR = VARER.PLU_NR AND VARER.SERVICEYDELSE=0
where
transaktioner.art in (11) and
transaktioner.Dato>='2010-11-01 23:59:59'
and transaktioner.Dato<='2010-12-01 23:59:59'
group by
transaktioner.Afdeling_ID
third line in the where clauses also makes firebird pick what plan I like.
And - If my customer is not lying, this problem has comes forward the last few days, which means Firebird has started to guess another way tan before.