我有三张表
bulldozer_info 出工地表,有1万条数据
refuse_treatment_plant 进消纳厂表,有100条数据
input_output_status 驶入驶出状态表
bulldozer_info和refuse_treatment_plant之间没有字段关联
在bulldozer_info中有字段id、license_number、begin_time、end_time、driving_status
在refuse_treatment_plant表有字段id、license_number、plant_name、entry_time、driving_status
input_output_status 驶入驶出状态表
这表有字段id, status_id, status_explanation
我希望将bulldozer_info和refuse_treatment_plant的数据都查出来,一共是1万100条,
然后字段包括bulldozer_info.id、refuse_treatment_plant.id、license_number、begin_time、end_time、entry_time、driving_status、plant_name、entry_time、driving_status、status_explanation
如果没有则为null
然后按照begin_time和entry_time进行排序
使用子查询+UNION ALL, 两个表的字段数量要一致, 没有的字段就是 常量填充.