Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do you do an SQL query for data that has '' in it ?
Sorry, I stand corrected. You are completely right.
The escape character can be used in where-clauses where you want to search
for characters, that are wildcards e.g. '%'
Suppose you have two rows:
'10% more'
'10 is enough'
then
select * from t1 where a1 like '10%'
will select both rows whereas
select * from t1 where a1 like '10\%%'escape'%'
will select only the first row.
Regards
Kurt Laugesen
kurtL_at_corebit.dk
shiling_at_math.wayne.edu wrote in message <7joa9a$g8v$1_at_nnrp1.deja.com>...
>Use double single quotes will do the trick. See below.
>
>SQL> select * from t
> 2 where a1='who''s this';
>
>A1
>----------
>who's this
>
>
>In article <375F8BB1.1B1A5891_at_uk.ibm.com>,
> Andrew Fisher <fishera_at_uk.ibm.com> wrote:
>> I have a problem in that I need to use an SQL statement 'SELECT * FROM
>> TABLE WHERE COLUMN_NAME = 'NAM'E'S'
>>
>> Basically the data in COLUMN_NAME has single speech marks in it - This
>> inevitabally causes problems for SQL. Does anyone know what SQL can
>use
>> to ovecome data with single speech marks.
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Jun 10 1999 - 10:44:54 CDT
![]() |
![]() |