【问题标题】:List the names of the Employees having '%' character in their name [duplicate]列出姓名中包含“%”字符的员工姓名[重复]
【发布时间】:2018-07-02 10:25:33
【问题描述】:

我想显示员工详细信息列表

Select * from EMPLOYEES where Name LIKE '%%%';

【问题讨论】:

标签: sql sql-server sql-server-2008


【解决方案1】:

一种方法使用ESCAPE

where name like '%$%%' ESCAPE '$'

这是 ANSI 标准语法。默认转义字符为\:

where name like '%\%%'

或者,我可能会在 SQL Server 中做的是:

where name like '%[%]%'

SQL Server 支持有限的字符类,但足以转义一个字符。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-07
    • 1970-01-01
    • 2021-07-22
    • 2021-10-18
    • 2017-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多