SQL Querries

  • Hello,

    I am a novice in sql. i have problems understanding the precedence of operators in a query and hence what the query does. can anyone suggest a method.

  • Hi,

    quote:


    I am a novice in sql. i have problems understanding the precedence of operators in a query and hence what the query does. can anyone suggest a method.


    what about posting the query first?

    Frank

    http://www.insidesql.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • nice one,

    i was talking in general

    and the precedences of select, from, where, etc.

    tried to search on precedences only to find that * > + etc.

  • quote:


    nice one,

    i was talking in general

    and the precedences of select, from, where, etc.

    tried to search on precedences only to find that * > + etc.


    and you didn't find anything valuable in BOL?

    Frank

    http://www.insidesql.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • SELECT, FROM, WHERE etc are not operators, they are keywords that introduce different parts of a SQL statement. They don't really have a precedence so much as they all have to follow legal SQL syntax. Start with the SELECT statement in Books On Line and look at the syntax diagrams.

    A very general syntax would be:

    SELECT <fieldlist>

    FROM <tables>

    WHERE <logicalexpression>

    GROUP BY <fields>

    ORDER BY <fields>

    A statement does not have to have all those parts, but they must be in that order.

Viewing 5 posts - 1 through 4 (of 4 total)

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