Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
SELECT  distinct ejp.JOB_POST_CODE,COMPANY_CODE,JOB_TITLE,JOB_DESCRIPTION
from EMPLOYER_JOB_POST ejp,
(SELECT COUNT(USER_CODE) count_user FROM EMPLOYER_APPLY_JOB eaj
where eaj.COMPANY_CODE='CC0000001'
GROUP BY JOB_POST_CODE) applied_job
where ejp.COMPANY_CODE='CC0000001' order by ejp.JOB_TITLE asc



this is my query its have two table one is employe post job which containg job title and job description with job id and other table have user code with jb id . contain the data of no. of user applied for particular job.
i m creating proc with CALCULATE THE NO. OF USER APPLIED FOR PARTICULAR JOB WITH JOB DETAILS.

PLEASE HELP ME..............

THANK YOU IN ADVANCE
Posted
Updated 9-Jul-13 1:54am
v2
Comments
CHill60 9-Jul-13 16:44pm    
I hope you don't mind me passing on a little bit of advice... using all CAPITALS is usually considered to be "shouting" and can put people off helping you. If you need to post any more questions (or even solutions!) please remember to use sentence case. Happy Coding

Hi, try this...



SQL
SELECT distinct ejp.JOB_POST_CODE,ejp.COMPANY_CODE,ejp.JOB_TITLE,ejpJOB_DESCRIPTION,Eaj.count_user
from EMPLOYER_JOB_POST ejp
Left join
(
SELECT JOB_POST_CODE,COUNT(USER_CODE) count_user FROM EMPLOYER_APPLY_JOB
GROUP BY JOB_POST_CODE
)eaj
On ejp.JOB_POST_CODE=eaj.JOB_POST_CODE
where ejp.COMPANY_CODE='CC0000001'
order by ejp.JOB_TITLE asc
 
Share this answer
 
Since I dont have data I cant verify. Just give it a try.

SQL
SELECT distinct ejp.JOB_POST_CODE,COMPANY_CODE,JOB_TITLE,JOB_DESCRIPTION
from EMPLOYER_JOB_POST ejp inner join
(SELECT COUNT(USER_CODE) count_user FROM EMPLOYER_APPLY_JOB eaj
GROUP BY JOB_POST_CODE) applied_job on applied_job.COMPANY_CODE= ejp.COMPANY_CODE
where ejp.COMPANY_CODE='CC0000001' order by ejp.JOB_TITLE asc
 
Share this answer
 
SQL
SELECT  distinct COUNT(USER_CODE) count_user,ejp.JOB_POST_CODE,COMPANY_CODE,JOB_TITLE,JOB_DESCRIPTION
from EMPLOYER_JOB_POST ejp inner join EMPLOYER_APPLY_JOB eaj on 
eaj.COMPANY_CODE=eaj.COMPANY_CODE where eaj.COMPANY_CODE='CC0000001'
group by ejp.JOB_POST_CODE,COMPANY_CODE,JOB_TITLE,JOB_DESCRIPTION
 
Share this answer
 
I think u have to join the table
 
Share this answer
 
Comments
Basmeh Awad 9-Jul-13 7:56am    
then also provide him how to join..that what he is asking
Nirav Prabtani 9-Jul-13 7:57am    
please mention it as comment it is not an answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900