Есть запрос:
Код: Выделить всё
with taxfree_names as(
select '' as textinname from rdb$database
union
select 'pill' from rdb$database
union
select 'book' from rdb$database
union
select 'chocolat' from rdb$database
)
select (select count(*) from taxfree_names where 'packet of headache pills' like '%'||textinname||'%')
from rdb$database
если использую фразу, то возвращает 1:
Код: Выделить всё
with taxfree_names as(
select '' as textinname from rdb$database
union
select 'pill' from rdb$database
union
select 'book' from rdb$database
union
select 'chocolat' from rdb$database
union
select 'headache pill' from rdb$database
)
select (select count(*) from taxfree_names where'packet of headache pills' like '%'||textinname||'%')
from rdb$database