22,298
社区成员
发帖
与我相关
我的任务
分享select activityName,isnull(countryName,'ALL') as countryName
from activity
right join country
on activity.countryCode = countryb.countryCodeselect activityname,isnull(countryname,'ALL') as countryname
from activity a
right join country b
on a.countryCode = b.countryCodeselect activityname,isnull(countryname,'ALL') as countryname
from activity a
left join country b
on a.countryCode = b.countryCode
select a.countryName,activityName=isnull(b.activityName,'ALL') from country a left join activity b
on a.countryCode=b.countryCode
isnull(countryCode,'ALL')/*
表activity:
id(主键), countryCode(外键), activityName
表country :
countryCode(主键), countryName
*/
select Ac.activityName,isnull(Ac.countryCode,null),Co.countryName
from activity Ac join country Co on Ac.countryCode=Co.countryCode