You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/20131209/查询ciq与对应许可证不匹配的货物.sql

9 lines
411 B
MySQL

2 years ago
select c.id,c.cargoinfo_id,c.cargociq_id,
(select ciqcode from Import_cargociq where id=c.cargociq_id) cargociq,
a.cargoinfo_id,a.cargociq_id,
(select ciqcode from Import_cargociq where id=a.cargociq_id) appciq
from import_cargo c
left join Import_appstate s on s.cargo_id=c.id
left join Import_approval a on a.id=s.app_id
left join import_main m on m.contractno=c.contractno
where c.cargociq_id<>a.cargociq_id