select *
from lorsm_cmi_core
where track_id=:track_id
select min(lorsm.track_id) as mint from lorsm_cmi_core cmi, lorsm_student_track lorsm
where lorsm.community_id=:community_id
and lorsm.course_id=:man_id
and user_id=:user_id
and lorsm.track_id=cmi.track_id
and lorsm.track_id>:track_id
select *
from lorsm_student_track lorsm, ims_cp_manifests manif
where lorsm.community_id=$community_id
and lorsm.course_id=$man_id
and (lorsm.track_id>=$track_id $querypart)
and manif.man_id=$man_id
and user_id=$user_id
order by lorsm.track_id asc