Ad-hoc Query: Protocols w/Special Category ------------------------------------------ Old Version =========== SELECT q.doc_id, d.title FROM query_term as q, query_term as q1, document as d WHERE q.doc_id=q1.doc_id AND q.doc_id=d.id AND q.path LIKE '/InScopeProtocol/ProtocolSpecialCategory/SpecialCategory' AND q.value IN ('NCI web site featured trial') AND q1.path LIKE '/InScopeProtocol/ProtocolAdminInfo/CurrentProtocolStatus' AND q1.value IN ('Active', 'Approved-not yet active', 'Temporarily Closed', 'Closed') ORDER BY d.title; New Version =========== SELECT q.doc_id, d.title FROM query_term q JOIN query_term q1 ON q1.doc_id = q.doc_id AND (q1.path = '/InScopeProtocol/ProtocolAdminInfo' + '/CurrentProtocolStatus' OR q1.path = '/CTGovProtocol/OverallStatus' ) AND q1.value IN ('Active', 'Approved-not yet active', 'Temporarily Closed', 'Closed') JOIN document d ON d.id = q.doc_id WHERE (q.path = '/InScopeProtocol/ProtocolSpecialCategory' + '/SpecialCategory' OR q.path = '/CTGovProtocol/PDQAdminInfo' + '/ProtocolSpecialCategory' + '/SpecialCategory' ) AND q.value IN ('NCI web site featured trial') ORDER BY d.title