2017-05-12 16 views

回答

2

您需要在搜索項兩端通配符標記。使用||操作者不太打字:)

select * 
from emp 
where ename like '%' || p_name || '%' 

爲了做同樣的concat()需要兩次調用函數:

select * 
from emp 
where ename like concat('%', concat(p_name, '%')) 
+0

使用'CONCAT()'是不可能的,因爲反正Oracle的' concat()'不支持多於兩個參數 –

+0

@a_horse_with_no_name - 不使用'concat()'* once *,no – APC

+0

啊,這就是你的意思是「less typing」; –

相關問題