How many years leading up to 1242 had they carried out with the royal affairs?
return the  royal affairs ;return years that they carried out with #1 ;return #2 leading up to 1242 ;return number of  #3
['select', 'project', 'filter', 'aggregate']