Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: lookup in an existing table with null values

  1. #1

    Default lookup in an existing table with null values

    Hi folks,
    old problem, many threads here, but i couldn't find a howto or work around. I have an existing table with fieldtype = smallint or numeric. But many of these fields are containing a NULL value. If I do a
    SELECT .. WHERE field1 IS NULL
    it works.
    BUT I need also a SELECT .. WHERE field1 = 2
    for the numeric data in the same column.
    There should be a switch for every column to use this or that SELECT?
    But I have several columns, so many combinations.
    As you can expect, I have right to modify the existing table, it's from an outdated application.
    No idea how to achieve this - or should I take a sleep and by tomorrow I get to the point, why did I not see ... It's so obvious?!
    Any help very appreciated,
    Cheers, Alexander

  2. #2
    pstoellberger Guest


    Where are you trying to achieve this? Table Input? DB Lookup?

    You can always have a SQL Statement like:
    SELECT * from table_xyz where (col1 is null OR col1 = 2) AND (col2 is null OR col2 = 3) .....

  3. #3

    Default dblookup with null value and numeric values

    PSt., Thanks for your reply, yes you're right, should clarify ...
    I tried to implement this with a dblookup.
    There are two possible fields to use, I didn't find in the manual any hint, is this used for an AND or an OR? Therefor I didn't take this 2nd column in my focus. Is this the way to implement your OR clause?
    Every line addt. line is an AND?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.