June 27, 2013 at 9:46 pm
Comments posted to this topic are about the item How does SQL pronounce SQL?
-----
a haiku...
NULL is not zero
NULL is not an empty string
NULL is the unknown
June 27, 2013 at 9:50 pm
Thanks for the Question Ron! I never used DIFFERENCE function earlier. Got to learn something today
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
June 27, 2013 at 11:30 pm
Lokesh Vij (6/27/2013)
Thanks for the Question Ron! I never used DIFFERENCE function earlier. Got to learn something today
+1
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
June 27, 2013 at 11:30 pm
Very Interesting question.. Thanks Ron.. Helped to walk through SOUNDEX and DIFFERENCE..
June 28, 2013 at 12:49 am
Love the question Didn't know I was working with a sick whale:
SELECT DIFFERENCE('Sql','sickwhale')
Best Regards,
Chris Büttner
June 28, 2013 at 1:37 am
-
--
Dineshbabu
Desire to learn new things..
June 28, 2013 at 1:37 am
Good question, Learned two new functions. But i don't know where can I use it.
--
Dineshbabu
Desire to learn new things..
June 28, 2013 at 5:05 am
Dineshbabu (6/28/2013)
Good question, Learned two new functions. But i don't know where can I use it.
[Code="sql"]
declare @Nations table(Name varchar(20))
insert into @Nations Values
('Sri Lanka'),('Sree Lanka'),('Sri Lanka'),('Sri Langa'),('Sree Langa')
select * from @Nations
select Soundex(Name) from @Nations
update @Nations set Name = 'Sri Lanka'
Where Soundex(Name) = Soundex('Sri Lanka')
select * from @Nations
[/code]
By Running the above query, It can be understood one of the purpose.
June 28, 2013 at 5:50 am
I admit I've never used the SOUNDEX or DIFFERENCE functions before, so I got to learn something today. That's always a good way to start the day. Thanks for the interesting question to end the week.
June 28, 2013 at 6:28 am
Christian Buettner-167247 (6/28/2013)
Love the questionDidn't know I was working with a sick whale:
SELECT DIFFERENCE('Sql','sickwhale')
omg. This made my day! Thank you. When I get home tonight, I'm letting my kids know that I became a marine biologist. I'll let them decide whether that's a promotion or lateral move...
June 28, 2013 at 6:37 am
It doesn't strike me as a particularly useful function, especially given these examples:
SELECT SOUNDEX('cent') --C530
SELECT SOUNDEX('scent') --S253
SELECT DIFFERENCE('cent','scent') --2, a very weak match
SELECT SOUNDEX('through') --T620
SELECT SOUNDEX('threw') --T600
SELECT DIFFERENCE('through','threw') --3, a fair match
--an attempt at regional diplomacy?
SELECT SOUNDEX('route') --R300
SELECT SOUNDEX('root') --R300
SELECT SOUNDEX('rout') --R300
SELECT DIFFERENCE('root','rout') --4, a perfect match
SELECT DIFFERENCE('root','route') --4, a perfect match
SELECT DIFFERENCE('rout','route') --4, a perfect match
--let's see if the US and Canada can put this to rest once and for all:
SELECT SOUNDEX('about') --A130
SELECT SOUNDEX('aboot') --A130
SELECT SOUNDEX('abowt') --A130
SELECT SOUNDEX('abeet') --A130
--all of these will DIFFERENCE with a result of 4, of course
So that seems pretty useless.
ron
-----
a haiku...
NULL is not zero
NULL is not an empty string
NULL is the unknown
June 28, 2013 at 7:46 am
nice question
---------------------------------------------------------------------
June 28, 2013 at 8:16 am
Got mixed up in my order on the answer. Love the question. Seems like something I would never get to use but I could see a time and place in the future (moving into education database) that I might be able to get a couple of uses out of this.
June 28, 2013 at 8:23 am
ronmoses (6/28/2013)
It doesn't strike me as a particularly useful function, especially given these examples:
...
So that seems pretty useless.
ron
+1
June 28, 2013 at 9:03 am
While I wouldn't trust the results without checking them by eye (or expect all cases to be found) DIFFERENCE can be used as a quick and dirty way of identifying a short list of possible duplicate records.
SELECT P1.*, P2.*
FROM People AS P1
INNER JOIN People AS P2
ON P1.Date_of_Birth = P2.Date_of_Birth
AND P1.Last_Name = P2.Last_Name
WHERE P1.Person_ID <> P2.Person_ID
AND DIFFERENCE(P1.First_Name,P2.First_Name) = 4
Fuzzy grouping through SSIS is a lot more sophisticated but the above query (or variants swapping first and last name) will give a quick idea of what you're facing very quickly.
Viewing 15 posts - 1 through 15 (of 43 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy