select category_id, category_name
from ec_categories
order by category_name
select c.category_id, s.subcategory_id, category_name, subcategory_name
from ec_categories c left
outer join ec_subcategories s using (category_id)
select subcategory_id, subcategory_name
from ec_subcategories
where category_id = :category_id
order by subcategory_name
select subcategory_id
from ec_subcategories
where category_id = :category_id
select subcategory_name
from ec_subcategories
where subcategory_id = :subcategory_id
select subcategory_id
from ec_subcategories
where category_id = :category_id
and subcategory_id in ([join $subcategory_list ","])
order by subcategory_name
select subsubcategory_id
from ec_subsubcategories
where subcategory_id = :subcategory_id
and subsubcategory_id in ([join $subsubcategory_list ","])
order by subsubcategory_name
select picklist_item
from ec_picklist_items
where picklist_name = 'issue_type'
order by sort_key
select picklist_item
from ec_picklist_items
where picklist_name = 'info_used'
order by sort_key
select picklist_item
from ec_picklist_items
where picklist_name='interaction_type'
order by sort_key