0

3 つのテーブルを使用してストアド プロシージャを作成する必要があります。1 つ目は、登録テーブル、求職者テーブル、雇用詳細テーブルです。その中で、最初の 2 つのテーブルにエントリがあります。今まで、雇用詳細テーブルにエントリがありません。

次のクエリがあります。

select RD.FirstName,RD.LastName,
(select case when JR.profileHeadline=''
then 'No Resume Headline mentioned' 
else JR.profileHeadline end
from jobseekerReg JR)as profileHeadline ,
(select case when ED.designation=''
then 'No designation mentioned'
else ED.designation end
from employmentDetail ED)as designation,
(select case when ED.companyName=''
then 'No company name mentioned'
else ED.companyName end
from employmentDetail ED) as companyName,JR.location,
(select case when ED.funcArea=''
then 'No functional area mentioned'
else ED.funcArea end
from employmentDetail ED) as funcArea ,
(select case when ED.cmpIndustry=''
then 'No industry mentioned'
else ED.cmpIndustry end
from employmentDetail ED)as cmpIndustry,RD.BirthDay,
RD.Gender,JR.experience,
(select case when ED.salary=''
then 'No salary mentioned'
else ED.salary end
from employmentDetail ED)as salary ,JR.mobileNumber,JR.emailId,
JR.altEmailID,JR.jobSeekerAddrs,JR.maritalStatus,
(select case when JR.keySkills=''
then 'No keyskills mentioned'
else JR.keySkills end
from jobseekerReg JR)as keySkills
from RegistrationDetails RD join jobseekerReg JR on RD.Reg_Id=JR.regId
left outer join employmentDetail ED on ED.regId=JR.regId 
and ED.regId=2  where RD.Reg_Id=JR.regId and RD.Reg_Id=2 and JR.regId=2

上記のクエリでは正しい出力が得られますが、雇用テーブルに regId=2 のエントリがないため、このテーブルの列は null として出力されます。この問題をどのように処理すればよいですか?解決策を提案してください。よろしくお願いします。

4

1 に答える 1