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/新协航_设计文档/数据库建表文档/1.0/vImportKcRpt.sql

14 lines
747 B
SQL

CREATE VIEW vImportKcRpt
AS
Select K.id,k.ContractNo,k.CZState,
(select enumvaluename from tsysenumvalue where enumtypeid=8 and enumvalueid=K.czstate) as CZRf,k.InNum,k.OutNum,
k.KFstate,(select enumvaluename from tsysenumvalue where enumtypeid=9 and enumvalueid=k.KFstate) as KFRf,
K.CZdate,K.[text],m.seller,m.buyer,m.Billno,m.Vessel,m.Voyage,m.Sailingdate,m.ArrivalDate,m.ContainerNo,m.SealNo,
c.name as goodname,c.cargoinfo_id,(select code from import_cargoinfo where import_cargoinfo.id=c.cargoinfo_id) as cargoinfoRf,
c.cargociq_id,(select ciqcode from import_cargociq where import_cargociq.id=c.cargociq_id) as cargociqRf
from [Import_KC] K
left join import_cargo c on c.id=k.cargo_id
left join Import_main m on m.ContractNo=k.ContractNo