Zitat von
jensw_2000:
Gibt es eine Möglichkeit CASE oder IF in der WHERE Clause zu verbauen, um Bedingungen auszuschliessen ?
Nein, die
SQL-Sprache lässt das nicht zu.
<search_condition> ist das, was hinter WHERE steht.
<predicate> kann entweder True oder False sein.
Code:
<search_condition> ::=
{ [ NOT ] <predicate> | ( <search_condition> ) }
[ {AND | OR} [NOT] {<predicate> | ( <search_condition> ) } ]
} [,...n]
<predicate> ::=
{ expression { = | < > | ! = | > | > = | ! > | < | < = | ! < } expression
| string_expression [NOT] LIKE string_expression
[ ESCAPE 'escape_character' ]
| expression [NOT] BETWEEN expression AND expression
| expression IS [NOT] NULL
| CONTAINS
( { column | * } , '< contains_search_condition >' )
| FREETEXT ( {column | * }, 'freetext_string' )
| expression [ NOT ] IN ( subquery | expression [ ,...n ] )
| expression { = | < > | ! = | > | > = | ! > | < | < = | ! < }
{ ALL | SOME | ANY} ( subquery )
| EXISTS ( subquery )
}