```SQL
SELECT curse.CurseNo 活動編號, curse.CurseName 活動名稱, b.EndDate 活動迄日,a.[WangNo] 企編,a.[CName] 姓名, emp.StoreNo 目前門店,emp.DeptName 目前部門,
emp.[Post_No] +' '+ emp.[PostName] 目前職稱
FROM [dbo].[TRN_CursePeople] a
left join PRS.dbo.V2_employee_View emp on emp.IDCard = a.IDCard
left join TRN_Curse curse on curse.CurseNo = [dbo].[GetCurseNo]([CurseGUID])
left join TRN_CurseRecord b on a.CurseGUID=b.rGUID
where
(curse.CurseName like '%玉山%' or curse.CurseName like '%寶島%' or curse.CurseName like '%日月潭%' or curse.CurseName like '%馬拉松%')
--Left(curse.CurseNo,2) ='SC'
and emp.WorkStateNo='00' --在職00、離職02
and emp.Grade >=4
order by curse.CurseNo,b.EndDate , emp.StoreNo,emp.DeptNo, a.[WangNo]
```