Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Use an SQL query as Variable

adnan645Jan 22 2021

select obj.object_name, als.alias_id from orf.hsp_object obj
LEFT JOIN
(select * from orf.hsp_alias where aliastbl_id = '14') als ON als.member_id=obj.object_id
where obj.object_type = '50';

I want to use the internal query i.e. select * from orf.hsp_alias where aliastbl_id = '14' as variable.. something like below

Define select * from orf.hsp_alias where aliastbl_id = '14' as als
select obj.object_name, als.alias_id from orf.hsp_object obj
LEFT JOIN
als ON als.member_id=obj.object_id
where obj.object_type = '50';

What should be the correct syntax for above? Thanks.

Comments
Post Details
Added on Jan 22 2021
2 comments
906 views