sql - Invalid identifier error when all listed elements exist -


i'm doing basic database assignment on etl. i'm trying update column referencing 3 distinct columns in 2 other tables.

i getting error report in sql developer:

sql error: ora-00904: "dimtime"."day_time": invalid identifier 00904. 00000 -  "%s: invalid identifier"`  

i feel syntax bad listed elements exist.

code snippet is:

update fact_stage set date_sk = (   select date_sk time_stage   (time_stage.year_time = dimtime.year_time)   , (time_stage.month_time = dimtime.month_time)   , (time_stage.day_time = dimtime.day_time) );  

as understand want add id time_stage table date_sk column in fact_stage table. propose change sql query like

update fact_stage set date_sk = (   select id -- identifier column in time_stage table     time_stage dim join fact_stage fact     on (dim.year_time = fact.year_time     , dim.month_time = fact.month_time     , dim.day_time = fact.day_time)    -- or instead of on part use "using (year_time, month_time, day_time)" );  

hope helps


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -