0

我有一个查询“namePrefix + ' ' + nameFirstname + ' ' + nameSurname AS salName”。如何在 Store Procedure Like Query 中使用它?

4

1 回答 1

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||'%';
于 2012-10-15T04:46:13.917 回答