In a table such as:
M & M Mickey
Jill & Co. Kate
D & G Thandi
XY and Z Alpheus
How do I return only the contacts
who work for companies with an '&'
in their names?
Uses the ASCII value
This should do the trick
where company like '%'||chr(38)||'%';
Great idea. It worked perfectly!
I also had suggestions to use 'set define off'
in sqlplus. Replacing with ascii equiv. would
avoid setting up the DBI to execute commands.
Just how would I do that? (is it easy to do?)
You can do the following if you don't want to use the ascii values.
SQL> set scan off
SQL> select contact from tablename
where company like '%&%';
SQL> set scan on
Remember to set the scan back to on, as if you are trying to accept values using the & and if the scan is off, the value won't be prompted for.
Click Here to Expand Forum to Full Width