Solved

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

Posted on 2011-02-25
7
355 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 500 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 500 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 13

Assisted Solution

by:Philip Pinnell
Philip Pinnell earned 500 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

739 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