Home » RDBMS Server » Server Administration » Searching for string with multiple spaces
Searching for string with multiple spaces [message #371222] Tue, 19 September 2000 17:40 Go to next message
gino
Messages: 2
Registered: September 2000
Junior Member
How could I write a select statement to search for all records with "1500(one space)Westlake(one space)North" if the table column
has "1500(multiple spaces)Westlake(multiple spaces)North ?
I've been trying to use LIKE and % but it doesn't work
Re: Searching for string with multiple spaces [message #371225 is a reply to message #371222] Wed, 20 September 2000 05:49 Go to previous messageGo to next message
Andreas Pollmeier
Messages: 7
Registered: February 2000
Junior Member
Hello Gino!

Why don't you use the replace-function to
delete (!) all spaces in the two strings
before comparing them.

Example:

select 'Got one!' from dual where replace
('1500 Westlake North',' ','')=replace('1500 ...many spaces... Westlake North',' ','');

Andreas

P.S.
Re: Searching for string with multiple spaces [message #371228 is a reply to message #371222] Wed, 20 September 2000 07:09 Go to previous message
Mahesh Pednekar
Messages: 28
Registered: August 2000
Junior Member
Try this

Select column1,column2 from table
where column like '%1500%Westlake%North%' ;

Use appropriate colum names
Previous Topic: Create a table....
Next Topic: Standby DB
Goto Forum:
  


Current Time: Sat Apr 20 00:10:14 CDT 2024