is this sql is proeritary or standerd sql.

  • hi,

    Select t.* from t

    where not exist ( select t1.id from t1 where t1.id=t.id

    union

    select t2.id from t2 where t2.id=t.id )

    is this syntax is proprietary or stranded sql?

    yours sincerley

  • Looks standard SQL-92 to me.

    Please note that the UNION could be a cheaper UNION ALL (doesn't perform a DISTINCT).

    -- Gianluca Sartori

  • spaghettidba (11/12/2014)


    Looks standard SQL-92 to me.

    Please note that the UNION could be a cheaper UNION ALL (doesn't perform a DISTINCT).

    I agree, except that your EXISTS needs an S on the end.

  • Ed Wagner (11/12/2014)


    I agree, except that your EXISTS needs an S on the end.

    Nice catch!

    -- Gianluca Sartori

  • is there any place where i can search it.

    please send me link.

    yours sinclerey

  • rajemessage 14195 (11/12/2014)


    is there any place where i can search it.

    please send me link.

    yours sinclerey

    BOL (Books on line) is the standard place to start and is accessed by the F1 key. More specifically this is from the online version http://technet.microsoft.com/en-us/library/ms187455(v=sql.105).aspx

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • If you're working within SQL Server, I wouldn't worry that much about product specific T-SQL. The vast majority of applications developed stay within the RDBMS that they're developed within. So, sticking to only ANSI compliant SQL when there are constructs that can help you within T-SQL is a very poor choice.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (11/13/2014)


    If you're working within SQL Server, I wouldn't worry that much about product specific T-SQL. The vast majority of applications developed stay within the RDBMS that they're developed within. So, sticking to only ANSI compliant SQL when there are constructs that can help you within T-SQL is a very poor choice.

    +1000! The illusion of portable code is just that...an illusion. Besides, if you're working in an environment, your should want to take advantage of everything that's specific to that environment to get the best performance possible. If you're planning to migrate to another database platform in the near future, it'll have its own environment-specific stuff, so code it there in the first place.

Viewing 8 posts - 1 through 7 (of 7 total)

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