Subject RE: [firebird-support] long condition faster?
Author Omacht András
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]