## How does SQL pronounce SQL?

 Author Message Rich Weissler SSCrazy Group: General Forum Members Points: 2514 Visits: 954 Christian Buettner-167247 (6/28/2013)Love the question Didn't know I was working with a sick whale:SELECT DIFFERENCE('Sql','sickwhale'):-Domg. 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 SSCrazy Group: General Forum Members Points: 2616 Visits: 1023 It doesn't strike me as a particularly useful function, especially given these examples:`SELECT SOUNDEX('cent') --C530SELECT SOUNDEX('scent') --S253SELECT DIFFERENCE('cent','scent') --2, a very weak matchSELECT SOUNDEX('through') --T620SELECT SOUNDEX('threw') --T600SELECT DIFFERENCE('through','threw') --3, a fair match--an attempt at regional diplomacy?SELECT SOUNDEX('route') --R300SELECT SOUNDEX('root') --R300SELECT SOUNDEX('rout') --R300SELECT DIFFERENCE('root','rout') --4, a perfect matchSELECT DIFFERENCE('root','route') --4, a perfect matchSELECT 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') --A130SELECT SOUNDEX('aboot') --A130SELECT SOUNDEX('abowt') --A130SELECT 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 zeroNULL is not an empty stringNULL is the unknown george sibbald SSC Guru Group: General Forum Members Points: 58636 Visits: 13706 nice question --------------------------------------------------------------------- cschlieve SSC-Enthusiastic Group: General Forum Members Points: 169 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 SSC Guru Group: General Forum Members Points: 95688 Visits: 21205 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 Right there with Babe Group: General Forum Members Points: 741 Visits: 992 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 P1INNER JOIN People AS P2 ON P1.Date_of_Birth = P2.Date_of_Birth AND P1.Last_Name = P2.Last_NameWHERE P1.Person_ID <> P2.Person_IDAND 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 SSCrazy Group: General Forum Members Points: 2616 Visits: 1023 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 zeroNULL is not an empty stringNULL is the unknown SQLDCH SSCertifiable Group: General Forum Members Points: 6143 Visits: 3533 Thanks Ron, awesome question. ----------------------------------------------------------------------------Sacramento SQL Server users group - http://sac.sqlpass.orgFollow me on Twitter - @SQLDCH----------------------------------------------------------------------------Yeah, well...The Dude abides. pchirags Hall of Fame Group: General Forum Members Points: 3339 Visits: 616 nice question..Thanks.. webrunner SSCoach Group: General Forum Members Points: 16810 Visits: 4141 Thanks - really cool question.- webrunner -------------------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