select distinct t.solution_id, cr.title, t.date, t.name_title, t.themes, o.organisation_id, o.organisation_name, c.surname, c.first_name, c.contact_id
from cr_folders cf, cr_items ci, cr_revisions cr, solutions t, (select organisation_name, idcompany, organisation_id from
csr_organisationsx ox, cr_items ic where ic.latest_revision = ox.revision_id) o,
(select contact_id, idcontact, first_name, surname from contactsx cx, cr_items ic where ic.latest_revision = cx.revision_id) c
where cr.revision_id = ci.latest_revision
and t.solution_id = cr.revision_id
and ci.parent_id = cf.folder_id
and cf.package_id = :package_id
and o.idcompany = t.idcompany
and t.idcontact = c.idcontact
[template::list::page_where_clause -and -name "solutions"]
[template::list::filter_where_clauses -and -name "solutions"]
[template::list::orderby_clause -orderby -name "solutions"]
I refuse to believe that this is the most efficient way to make sure that I only join with the latest revision (or live revision once we change to that). Any hints?
Request notifications