Results 1 to 2 of 2

Thread: decode

  1. #1
    Join Date
    Dec 1969

    Default decode

    In select query, I have where clause that compares ID(number) from table A with ID2(varchar) from table B. The problem is some of the ID2's have space in it instead of being null. How do I write a where clause where I can ignore ID2 with space in it? I tried using decode in where clause but that doesn't work. Any suggestion?

  2. #2
    Join Date
    Dec 1969

    Default Oracle right?

    DECODE is not available in all database products.<BR><BR>Just use the LTRIM and RTRIM functions and test for "" as<BR>well as null in your where clause.<BR><BR> I think you can do this:<BR><BR> where (ltrim(rtrim(colA)) in (null,""))

Posting Permissions

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