Subject AW: [firebird-support] long condition faster?
Author Check_Mail
Thank you, Andreas.

-----Ursprüngliche Nachricht-----
Von: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Gesendet: Donnerstag, 3. Januar 2019 14:42
An: firebird-support@yahoogroups.com
Betreff: RE: [firebird-support] long condition faster?

Hi Olaf!

select bon.*
from (select case when t.price > 100 then 'EXPENSIVE'
else 'CHEAP'
end buy_or_not
from <table> t) bon
where bon.buy_or_not = 'CHEAP'

András

From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Thursday, January 3, 2019 2:27 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] long condition faster?


Hello,

if I select a value:

....a.standort,
case when(a.fertigstellung <= :fstichtag) then 4 when ((fertigstellung >=
:fstichtag or fertigstellung is null) and abnahme <= :fstichtag) then 3 end
from ...

and I would check this in the where-condition, should I write the entire
text again or can I do it shorter?

Example:

Where case... is not null

If I set the Field "as fielda", I cannot do this: "where fielda is not null"

Thanks a lot!

Best regards

Olaf





__________ Information from ESET Mail Security, version of virus signature
database 18646 (20190103) __________

The message was checked by ESET Mail Security.
http://www.eset.com



__________ Information from ESET Mail Security, version of virus signature
database 18646 (20190103) __________

The message was checked by ESET Mail Security.
http://www.eset.com



[Non-text portions of this message have been removed]



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item on the
main (top) menu. Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links