• Pothiraj R (4/16/2013)


    Hi Chris,

    Thanks for the query. I didn't use the syntax like this.

    FROM (VALUES ('ooo'),('bbb'),('ccc'),('ddd'),('eee'),('fff'),('ggg'),('hhh'),('iii'),('jjj'),('kkk'),('lll')) d (name)

    In the same scenario, I will use UNION ALL with SELECT or insert the values in another table. Your query will be helpful for me. Thanks again.

    UNION ALL with SELECT is just another table-valued constructor but handy to know if you're connected to pre-2K8.

    You're welcome.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden