I'm trying to select the newest price from another table in a sub select. But I can't figure out how to get it working.
This is what I've tried:
select something, somthingelse,
(
select * from
(
select QUOTE_PRICE as old_price
from price_history
where price_history.part_no= article_table.part_no
order by valid_from desc
) where rownum=1
)
from article_table where rownum < 5
The subselect works by itself, but it can't find article_table.part_no:
SQL Error: ORA-00904: "article_table "."part_no": invalid identifier