开发者

Can we use OR with LIKE predicate in DB2 queries?

开发者 https://www.devze.com 2023-02-19 01:25 出处:网络
I have a query to select names of employee start with \'y\', then my query would be SELECT EMP_NM FROM EMP

I have a query to select names of employee start with 'y', then my query would be

SELECT EMP_NM FROM EMP
WHERE EMP_NM LIKE'Y%'

Say for example

I need to retrieve names of employee names start with both 'y' and 'z', do we 开发者_如何学运维have anything to suffice my requirement? It's something like using OR with LIKE, correct?

Your time and responses are highly appreciated.


WHERE EMP_NM LIKE 'Y%' OR EMP_NM LIKE 'Z%'

or, not sure if DB2 supports this (not even sure I have right link to documentation...)

WHERE EMP_NM LIKE '[YZ]%'
0

精彩评论

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