Fix todo access sql to account for multiple children/relationships