[英]select * from table_name where column like ' '
I need to find records containing html code such as ' ' But when I try to run the select * from table_name where column like ' %'
I got prompt asking for the value of nbsp. 我需要查找包含html代码的记录,例如'&nbsp'但是当我尝试运行
select * from table_name where column like ' %'
我得到了nbsp的值。 I guess the database thinks that nbsp is a parameter. 我想数据库认为nbsp是一个参数。 I am wondering if the is an escape character so that I can tell the database that "&" is part of my query string.
我想知道是否是一个转义字符,以便我可以告诉数据库“&”是我的查询字符串的一部分。 I tryed '\\ ' but didn't work.
我尝试'\\ n'但是没有用。
My environment is Oracle 9i with sqlplus client. 我的环境是带有sqlplus客户端的Oracle 9i。
Thanks. 谢谢。
反斜杠应该可以工作,但我认为你需要开始查询
SET ESCAPE ON
In PL/SQL, you would use: 在PL / SQL中,您将使用:
BEGIN select <Column> from <Table_name> into <Variable> where <Column> LIKE '\\ \\%' ESCAPE '\\'; END /
Resources: 资源:
Wilcards in SQL on PSOUG.org 在PSOUG.org上的SQL中的Wilcards
LIKE Condition in Oracle® Database SQL Language Reference 11g Release 2 (11.2) Oracle®数据库SQL语言参考11g第2版(11.2)中的LIKE条件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.