Can we use OR with LIKE predicate in DB2 queries?

2019-09-17 09:48发布

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.

标签: db2
1条回答
迷人小祖宗
2楼-- · 2019-09-17 10:09
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]%'
查看更多
登录 后发表回答