Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004

    Unanswered: Conditional evaluation in where clause

    Hi everybody

    I use this expression in my where clause
    ((isnull(<value>)) or (colname = <value>))
    if I set <value> to NULL the condition is skipped

    If I set the <value> to some real value it is evaluated

    i am in need of something similar for the IN statement, in that case <value> becomes <values list> but then
    ((isnull(<values list>)) or (colname in <values list>))
    if <values list> is null the condition is skipped otherwise i get an error because

    isnull((2,3,4)) is not accepted by mysql

    any suggestion to make this work?

  2. #2
    Join Date
    Apr 2005
    Baltimore, MD
    I think if you use the COALESCE function in your ISNULL statement, you may get what you are looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts