select termID,createdDate,termAuthID, termName, (select count(linkid) from expressions,arguments where expressions.exprid=arguments.exprid and arguments.termid=terms.termid) , (select count(ex1.linkid) from expressions as ex1,expressions as ex2,arguments where ex1.exprid=arguments.exprid and arguments.termid=terms.termid and ex2.authority=0 and ex1.linkid=ex2.linkid), (select count(ex1.linkid) from expressions as ex1,expressions as ex2,arguments where ex1.exprid=arguments.exprid and arguments.termid=terms.termid and ex2.authority=1 and ex1.linkid=ex2.linkid), (select count(ex1.linkid) from expressions as ex1,expressions as ex2,arguments where ex1.exprid=arguments.exprid and arguments.termid=terms.termid and ex2.authority=2 and ex1.linkid=ex2.linkid), (select count(ex1.linkid) from expressions as ex1,expressions as ex2,arguments where ex1.exprid=arguments.exprid and arguments.termid=terms.termid and ex2.authority=3 and ex1.linkid=ex2.linkid) from terms where authority=3 and termName not like '@@LMI-SPECIAL-TERM@@%' order by termSorted limit 500