) as cnt (cr, tb, cnt) on tm.creator = cnt.cr and tm.name = cnt.tb where tm.dbname $DBIN order by tm.name with ur ;