min Function (XQuery)

  • Comments posted to this topic are about the item min Function (XQuery)

  • This was removed by the editor as SPAM

  • Nice one

  • Nice one, always nice to learn something new!

  • good question, despite being on a horrible topic.

    I hadn't a clue, and it took me a long time to read enough about XQuery to work out even roughly what the thing meant, and then more time wondering what type it would try to convert the values to (I guessed it was some numeric type), and I never did work out what "one" turn into but obviously either "NULL" didn't sort low as NULL wasn't an option or impossible conversions don't deliver NULLs. So even after all that reading and thinking (and getting the right answer, perhaps just by luck) I learnt more from the explanation than I had from looking at documentation.

    Of course my attitude to anything XML in a relational database meant that I had a definite policy not to retain anything I learn about XML (other than extra detail about how awful it is), but this question has made me decide to retain one of the things I learnt as a result of it: that Microsoft's documentation of XQuery in SQL Server is just about the most useless collection of inadequate and incoherent documentation riddled with lacunae that I have ever come across.

    Tom

  • Good to know.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Off the beaten path, straightforward - thanks, Mikael!

  • I learned something, thanks.

  • Thank you for the post, this is really so new to me.

    I used till the value and the mentioning the path of the xml element but never ever tired writing FOR RETURN in the MIN clause. I looked in the BOL and couldn't find any topic related to this, any link with in-depth information on this matter?

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Ugh. XML. 😉

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply