我有 3个表:
Manager: manager_id, taluka_name
Employee: employee_id, employee_manager_id
Target: target_id, target_employee_id
现在我必须明确显示所有目标 taluka_name 的ListView。 我正在使用greenDao与SQlite数据库进行交互。
这是我尝试的过程,使用我使用的方法花了太长时间:
Step1: Get Manager ID for the taluka name from the DB.
Step2: Get Employee for the Target table->Employee ID.
Step3: Get Manager ID from the Employee table.
Step4: Compare if Both Manager ID are equal {if YES then target
belongs to that taluka}
以下是我想使用Greendao
完成的查询类型 SELECT *
FROM target t, location l, current c
WHERE t.target_location_id = l.location_id
AND t.target_location_id = c.school_id
AND t.target_status <> '0'
AND t.target_status <> '4'
AND DATEDIFF(NOW(),t.target_exec_end_time)<7