我有一个查询“namePrefix +''+ nameFirstname +''+ nameSurname AS salName”。 我如何在Store Query Like Query中使用它?
答案 0 :(得分:2)
select a.salName from (
select namePrefix || ' ' || nameFirstname || ' ' || nameSurname salName
from table1) a
where a.salName like `%partialName%`;
对于存储过程,如果l_full_name_search
表示保存搜索字符串的变量,则可以将查询写为:
select a.salName from (
select namePrefix || ' ' || nameFirstname || ' ' || nameSurname salName
from table1) a
where a.salName like '%'||l_full_name_search||'%';