tsql - Why isn't "NOT ( <search_condition> )" listed in definition? -


based on testing, where not valid sql syntax

  not ( x = 10  y > 5 ) 

however, don't follow definition:

to me, t-sql definition of search condition doesn't seem allow producing not ( <search_condition> )"

the spec/docs makes seem legitimate target unary negation predicate. produce not ( <search_condition> ) looks requires statement right hand side of conjunction or disjunction...is spec incorrect, or missing way produce this?

< search_condition > ::=      { [ not ] <predicate> | ( <search_condition> ) }      [ { , | or } [ not ] { <predicate> | ( <search_condition> ) } ]  [ ,...n ]  <predicate> ::=      { expression { = | < > | ! = | > | > = | ! > | < | < = | ! < } expression      | string_expression [ not ] string_expression    [ escape 'escape_character' ]      | expression [ not ] between expression , expression      | expression [ not ] null      | contains    ( { column | * } ,'< contains_search_condition >')      | freetext ( { column | * } ,'freetext_string')      | expression [ not ] in (subquery | expression [ ,...n ] )      | expression { = | < > | ! = | > | > = | ! > | < | < = | ! < }    { | | any} (subquery)      | exists (subquery)     }  

not listed in square brackets in both parts, meaning it's optional.

if expand this:

< search_condition > ::=      { [ not ] <predicate> | ( <search_condition> ) }      [ { , | or } [ not ] { <predicate> | ( <search_condition> ) } ]  [ ,...n ]  

, removing of square brackets , possibly contents, this:

< some_search_condition > ::= { not ( <search_condition> ) } 

which string matches.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -