Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Select column in main query from sub query (derived table) -

519937May 24 2010 — edited May 25 2010
Hi:

I have the following query - How do I select Tot_Atnd defined in the derived table

SELECT count(distinct c.prgm_id) AS "Total Completed", h.Tot_Atnd
FROM iplanrpt.vm_rpt_prgm c
INNER JOIN
*(SELECT PRGM_ID, SUM(CASE WHEN ATTENDED_IND = 'Y' THEN 1 ELSE 0 END) AS "Tot_Atnd" FROM iPlanrpt.VM_RPT_PRGM_ATND GROUP BY PRGM_ID) h*
ON c.PRGM_ID = h.PRGM_ID
*;*

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2010
Added on May 24 2010
19 comments
12,775 views