我有3个表MS SQL存储过程来获取值
Staff table:
EmpId CandidateId
------------------------
1 2
Candidate table:
CandidateId Firstname Last name CountryId PassportCountry
--------------------------------------------------------------------
1 Mark Antony 2 3
2 Joy terry 1 3
Country:
CountryId Name
---------------------------
1 USA
2 UK
3 Australia
用户将通过EmpId
的查询字符串,我需要根据empId
展现候选人的详细信息。我只有一个country
表,并将该表用于country
,passportport国家。所以我得到country name
时,我得到候选人的价值。
如何编写存储过程以获取候选详细信息。我不擅长SQL。你们能帮我解决这个问题吗?提前致谢。
嗨我试了下面的脚本来获得国家名称和护照国家名称。我可以得到国家名称,但不是护照国家。
SELECT
FirstName,
LastName,
PassportCountry,
Country.CountryName as Country
from Candidate
inner join Country
on country.CountryId=candidate.country
where [email protected];
向我们展示您试过的东西。 – JiggsJedi
你试过了什么SQL?结果是什么? –
嗨,我试了下面的脚本来获得国家名称和护照国家名称。我可以得到国家名称,但不是护照国家。 –