select author.object_id,author.object_name, count(paper_author.object_id) from objects author, objects author1,eav_objects paper_author where author.object_class=44 and paper_author.attribute_id=148 and (author.object_id = paper_author.value or author1.object_id=paper_author.value and lower(author1.name) like lower(left(author.name,length(author1_name)))) group by author.object_id,author.object_name order by COUNT(paper_author.OBJECT_ID) DESC, author.object_name
|