Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Is it possible for a query distinguish between 'London Bridge' and 'London  Bridge'

Posted on 2011-02-25
7
Medium Priority
?
367 Views
Last Modified: 2012-06-21
Is it possible for a query distinguish between 'London Bridge' and 'London  Bridge'

There are two spaces between London and Bridge?
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 13

Accepted Solution

by:
Philip Pinnell earned 2000 total points
ID: 34978135
They are different and will be treated as different

Where field='London  Bridge' will not return where field is 'London Bridge'

Did you want to treeat them as the same?
0
 
LVL 13

Assisted Solution

by:Philip Pinnell
Philip Pinnell earned 2000 total points
ID: 34978144
replace('london  bridge','  ',' ') = 'London Bridge'

replaces double space with single space. This does not address multiple spaces
0
 

Author Comment

by:Mr_Shaw
ID: 34978178
the following WHERE clause returns the same data

WHERE      Location ='Asia'

WHERE       Location ='Asia                  '

The are treated the same.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 13

Assisted Solution

by:Philip Pinnell
Philip Pinnell earned 2000 total points
ID: 34978199
try this

select 'same'
where 'london bridge'='london     bridge'

select 'same'
where 'london bridge'='london bridge'

Not the same results

MS SQL 2005
0
 

Author Comment

by:Mr_Shaw
ID: 34978231
True...

It is just the suffix white spaces

select 'same'
where 'london bridge'='london bridge    '

select 'same'
where 'london bridge'='london bridge'
0
 

Author Closing Comment

by:Mr_Shaw
ID: 34978243
thanks
0
 
LVL 13

Expert Comment

by:Philip Pinnell
ID: 34978350
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question