开发者

How to use variable in LIKE condition?

开发者 https://www.devze.com 2023-02-16 18:12 出处:网络
currently i am using the following query in TOAD, DEFINE @name char(6); SET @name = \'Ronie\'+\'%\'; select * from employee where name like @name;

currently i am using the following query in TOAD,

DEFINE @name char(6);
SET @name = 'Ronie'+'%';
select * from employee where name like @name;

It is giving a "missing expression" I am using TOA开发者_如何学GoD for Oracle.


I'm hopeful this works

DEFINE NAME = "Ronie%" (CHAR);
select * from employee where name like '&&name';


Maybe problem is here: not 'Ronie'+'%' but 'Ronie'||'%'

0

精彩评论

暂无评论...
验证码 换一张
取 消