Wiki source for QueriesActiveStateLegOfficials
%%(language-ref)
SELECT c.firstname, c.lastname, voc.state_id, voc.office, voc.districtname, c.gender, c.birthdate
FROM candidate c
JOIN v_office_candidate voc
USING (candidate_id)
WHERE voc.status = 'active' AND voc.officetype_id = 'L'
ORDER BY voc.state_id, voc.office, voc.districtname_id ;
%%
SELECT c.firstname, c.lastname, voc.state_id, voc.office, voc.districtname, c.gender, c.birthdate
FROM candidate c
JOIN v_office_candidate voc
USING (candidate_id)
WHERE voc.status = 'active' AND voc.officetype_id = 'L'
ORDER BY voc.state_id, voc.office, voc.districtname_id ;
%%