开发者

How to use variable in LIKE condition?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜