-
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);
-
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
-
Forum Rules
|
|