The Great Escape

  • Comments posted to this topic are about the item The Great Escape

  • 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."

  • 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

  • Interesting Question and learnt something new today, Never escaped before 🙂

  • It would be better to define the collation. If it's case sensitive, then 'Tea' will not match 'tea'. 😛

  • very interesting question, yes i have learned something new today. thanks Andy

  • Thanks Andy ... learnt something new today. Hadn't used the escape clause before. Should be handy.

  • palotaiarpad (6/25/2014)


    It would be better to define the collation. If it's case sensitive, then 'Tea' will not match 'tea'. 😛

    No, it would be better to assume the default collation applies.

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • 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.

  • 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

  • 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.

  • 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.



    Everything is awesome!

  • Great question! Now I LIKE ESCAPE too.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • 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.

  • 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