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!

How to determine number of records in a subquery

user9075218May 18 2015 — edited May 19 2015

I'm fairly new to Oracle SQL and would like to know if anyone has any examples of how to do the following:

  1. I'd like to return the number of rows that exist in the following SQL Statement listed below. This SQL will be part of a larger SQL statement and I will be passing in the EMPLID identifier into the subquery. The result needs to be one value displaying the total number of records that match the SQL below. 'xyz' will eventually be passing in an employee's job position number using a reference from the parent SQL... ie: jbe.POSITION_NBR
  2. My SQL:

SELECT cjbe.EMPLID FROM PS_JOB cjbe
WHERE cjbe.POSITION_NBR = 'xyz'
GROUP BY cjbe.EMPLID

I'd like to know how I can pass in the poarent value of POSITION_NBR (I think I use jbe.POSITION_NBR) into my subquery and then return the total count of the EMPLID's found within that subquery.

Thanks for your help.

This post has been answered by John Stegeman on May 19 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2015
Added on May 18 2015
4 comments
4,925 views