SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How does SQL pronounce SQL?


How does SQL pronounce SQL?

Author
Message
Rich Weissler
Rich Weissler
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2061 Visits: 954
Christian Buettner-167247 (6/28/2013)
Love the question Smile Didn't know I was working with a sick whale:

SELECT DIFFERENCE('Sql','sickwhale')
:-D

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...
ronmoses
ronmoses
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1257 Visits: 996
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

george sibbald
george sibbald
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10872 Visits: 13687
nice question

---------------------------------------------------------------------
cschlieve
cschlieve
SSC-Enthusiastic
SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)SSC-Enthusiastic (109 reputation)

Group: General Forum Members
Points: 109 Visits: 309
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.
Luis Cazares
Luis Cazares
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17474 Visits: 19122
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


Luis C.
General Disclaimer:
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?


How to post data/code on a forum to get the best help: Option 1 / Option 2
BarneyL
BarneyL
Mr or Mrs. 500
Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)

Group: General Forum Members
Points: 561 Visits: 974
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.
ronmoses
ronmoses
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1257 Visits: 996
BarneyL (6/28/2013)
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.


I actually had to script something with a similar objective quite recently, and it didn't even occur to me to use this approach. I think I'll revisit that, thanks!

ron

-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown

SQLDCH
SQLDCH
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2268 Visits: 3399
Thanks Ron, awesome question.

----------------------------------------------------------------------------
Sacramento SQL Server users group - http://sac.sqlpass.org
Follow me on Twitter - @SQLDCH
----------------------------------------------------------------------------

Yeah, well...The Dude abides.
pchirags
pchirags
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2381 Visits: 615
nice question..
Thanks..
webrunner
webrunner
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4279 Visits: 3887
Thanks - really cool question.

- webrunner

-------------------
"I love spending twice as long and working twice as hard to get half as much done!" – Nobody ever.
Ref.: http://www.adminarsenal.com/admin-arsenal-blog/powershell-how-to-write-your-first-powershell-script

"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search