postgresql7.3
select eg.grade_plural_name,
eg.grade_id
from evaluation_gradesx eg, acs_objects ao
where content_revision__is_live(eg.grade_id) = true
and eg.item_id = ao.object_id
and ao.context_id = :package_id
order by grade_plural_name desc
select evaluation__class_total_grade(:user_id,:package_id)
select sum(et.weight*eg.weight)/100
from evaluation_gradesi eg, evaluation_tasks et, acs_objects ao
where eg.grade_id = et.grade_id
and eg.item_id = ao.object_id
and ao.context_id = :package_id
and content_revision__is_live(eg.grade_id) = true
and content_revision__is_live(et.task_id) = true