Hello,
I am using Oracle 9.2.0.3. I want to find out what columns exist in one table but don't exist in another table. Here is the SQL:
select a.column_name dim_col
, b.column_name hist_col
from user_tab_columns a left outer join user_tab_columns b
on a.column_name = b.column_name
where a.table_name = 'T_DIM'
and b.table_name = 'T_HIST_DIM'
order by 1
The T_DIM table has 100 columns in it and the T_HIST_DIM table has 40. I was expecting that this query would return 100 rows with NULLs for the hist_col where there were no matches; instead I only got 40 rows. I tried rewriting the query using 8i syntax and got the same results. I have asked several other developers and they all think that I should be getting 100 rows back. What's going wrong?
Thanks,
Padre
I am using Oracle 9.2.0.3. I want to find out what columns exist in one table but don't exist in another table. Here is the SQL:
select a.column_name dim_col
, b.column_name hist_col
from user_tab_columns a left outer join user_tab_columns b
on a.column_name = b.column_name
where a.table_name = 'T_DIM'
and b.table_name = 'T_HIST_DIM'
order by 1
The T_DIM table has 100 columns in it and the T_HIST_DIM table has 40. I was expecting that this query would return 100 rows with NULLs for the hist_col where there were no matches; instead I only got 40 rows. I tried rewriting the query using 8i syntax and got the same results. I have asked several other developers and they all think that I should be getting 100 rows back. What's going wrong?
Thanks,
Padre