Results 1 to 2 of 2

Thread: PL SQL subquery question

  1. #1
    Join Date
    May 2005
    Posts
    111

    PL SQL subquery question

    i have a table (phsload) with 160 records and when i run the following query i receive a resultset of 3 records.

    select "UUID", "GUID" from CCDBA.phsload
    where TO_CHAR(UUID) IN
    (SELECT TO_CHAR(USER_UID) FROM PORTAL.USERGROUPMEMBERSHIP);

    however when i ask for the opposite and add NOT IN i receive a nullset--it should return the other 157 records. PLEASE HELP!!!

    select "UUID", "GUID" from CCDBA.phsload
    where TO_CHAR(UUID) NOT IN
    (SELECT TO_CHAR(USER_UID) FROM PORTAL.USERGROUPMEMBERSHIP);

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Are there NULL values in USER_UID?

    Also make sure that the TO_CHAR(UUID) and TO_CHAR(USER_UID) are same length, or use RTRIM.

Posting Permissions

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