SELECT
  A.SubTypeID,
  A.AttendanceTypeID,
  B.AppointmentType,
  A.SubAppointmentType,
  A.OnLine
FROM
  taAppointmentSubType AS A
    LEFT JOIN tbAppointmentTypes AS B ON (B.AttendanceTypeID = A.AttendanceTypeID)
WHERE
  (A.SubTypeID = @nSubTypeID)
