Repetitive Operators

  • Hi..

    We can fetch the same result by using !<(Not Less than) or >=(Greater than or equal to).

    In the same way,

    we can fetch the same result by using !>(Not Greater than) or <=(Less than or equal to).

    Then what is the use of introducing both the operators...???

    [font="Comic Sans MS"]Praveen Goud[/font]

  • Praveen Goud Kotha (7/19/2010)


    ...

    Then what is the use of introducing both the operators...???

    ...

    It is matter of preference...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Joe Celko (7/19/2010)


    History. Sybase was written in C on UNIX decades ago. The use of ! and % in SQL is not standard and looks awful

    "!=" it is sure not-ISO standard, but many developers use it, I guess as it is very common in the programming languages (eg. C# etc.)

    I have a different taste... so, there are many other symbols or combination of them which look yeuky in SQL, you can easely argue what looks more or less awful 😀

    As long as you code is nicely formatted and its style is consitent, it is no much difference of what you use. It's fully up to you.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Hi..

    Can any one say....which of the above operators are preferable when it comes to the Optimization point of view..

    [font="Comic Sans MS"]Praveen Goud[/font]

  • No difference, !< is translated to be >= by the engine. Try both and have a look at the predicates in the execution plan



    Clear Sky SQL
    My Blog[/url]

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

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