Sådan gjorde du det - alias i kolonnenavnet
select
-- etc etc
(select innerDLI.datetime_created from distribution_line_items innerDLI where innerDLI.item_number = distribution_line_items.item_number order by innerDLI.datetime_created asc limit 1) as Origination,
-- etc etc
from distribution_stop_information
-- etc etc
Her er hvordan du kan sætte det i hvor, alias i join
select
-- etc etc
Origination.datetime_created
-- etc etc
from distribution_stop_information
left join distribution_line_items AS Origination ON Origination.item_number = distribution_line_items.item_number
where Origination.datetime_created > to_date(?, 'YYYY-MM-DD') - interval '180 days'
-- etc etc
Der er intet ved dette, der er bedre end den løsning, du postede (sql-optimeringsværktøjet skulle resultere i den samme plan), men den "bruger et alias i where-klausulen"