"Serge Buzadzhy" <[EMAIL PROTECTED]> wrote:
>
> Ну ка перепиши изначальный запрос
>
> select * from test_null t where (t.test_str=:test_null0)
>
> на запрос с "or is null" так чтобы при нулл параметре он давал
> t.test_str is null... и при этом еще и работал. А я полюбуюсь.

select *
from test_null t
where (t.test_str = :param) or (t.test_str is null and cast(:param as 
char(1)) is null)

P.S. YA и FB2 :-)
P.P.S. Работать будет медленно, т.к. индекс тут не светит.


--
Дмитрий Еманов




--~--~---------~--~----~------------~-------~--~----~
-~----------~----~----~----~------~----~------~--~---

Ответить