联合查询:
select departments_category.category_name,departments_category.category_code,departments.department_name,departments.department_code
from departmentsINNER JOIN departments_category
on departments.departments_category_id=departments_category."id"
where departments.hospital_id='hsyyadmin'
ORDER BY departments.department_name;
关于时间:
select "sum"(order_amount) from new_order where hospital_id='syzyyadmin'
and (create_time between to_date('2015-11-01','yyyy-MM-dd') and to_date('2015-11-31','yyyy-MM-dd'));