June 24, 2014 at 10:33 pm
Comments posted to this topic are about the item The Great Escape
June 24, 2014 at 11:13 pm
One more interesting querstion and nice explanation. Thanks Andy.
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
June 24, 2014 at 11:56 pm
Very interesting question, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 25, 2014 at 12:20 am
Interesting Question and learnt something new today, Never escaped before 🙂
June 25, 2014 at 12:39 am
It would be better to define the collation. If it's case sensitive, then 'Tea' will not match 'tea'. 😛
June 25, 2014 at 12:50 am
very interesting question, yes i have learned something new today. thanks Andy
June 25, 2014 at 2:07 am
Thanks Andy ... learnt something new today. Hadn't used the escape clause before. Should be handy.
June 25, 2014 at 2:55 am
June 25, 2014 at 5:17 am
Thank you Andy for the interesting post, out of 3, I got 2 correct (based on my assumptions with 0% confidence), it was difficult for me to do all the mental calculations, but really enjoyed the post. Have to focus on this area deeply deducing without executing. 🙂
(I wonder- Out of 63% of correct answers not sure how many are there who got it right naturally by analysing the post and not by executing and selecting the answers.)
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
June 25, 2014 at 6:39 am
Nice question. A bit convoluted to do in ones head, but in reality the only difficulty is working out whether the first query returns 1 or 2 rows, ie whether 't' matches '[t-a]'; I decided to guess that matching this pattern would behave like "between", ie the test would be 't'>='t' and 't'<='a', which of course means that the match would fail, so the first query would produce only one row. Luckily that guess was right, so I got the points. I have to admit that had I needed to know this for some real purpose rather than for QotD I would either have looked it up or tried it to see rather than using my guess for something real.
But I wonder why it was points rather than point, when that was the only thing that would fool anyone who had actually used LIKE in anger.
Tom
June 25, 2014 at 7:02 am
Okay, that was one of the cooler questions I've seen. I've never used ESCAPE before and I've never even thought of putting search patterns into a table. Your question really has me thinking, so thanks very much for it.
June 25, 2014 at 7:46 am
Ed Wagner (6/25/2014)
Okay, that was one of the cooler questions I've seen. I've never used ESCAPE before and I've never even thought of putting search patterns into a table. Your question really has me thinking, so thanks very much for it.
+1 I'd have to say that Ed summed it up for me. Neither thought had really sparked across my brain wires. I have much research to do now. Thanks for the great question.
June 25, 2014 at 8:50 am
Is there actually a point to ESCAPE? You can include wildcard characters in the LIKE string by enclosing them in square brackets, so I'm really not sure why you'd ever need to use it.
June 25, 2014 at 9:13 am
I like the question. My reasoning is the subtle nuance of storing the escape character in the table. I like it.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 15 posts - 1 through 15 (of 42 total)
You must be logged in to reply to this topic. Login to reply