N>select a.id, a.Caption, g.Period /*, grp.Name*/ from Groups grp N>inner join Grants g on grp.GroupID = g.GroupID and g.GroupID = @GID N>right join Actions a on a.id = g.ActionID N>