我有两个条件的 sql 结果..我需要在 asp 的同一列中打印这两个条件..
sql查询
select P.[Port Name], CR.Name as country,CASE
when SIH.[Ship-to Code] = '' then (select C.Name from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])
end as name,
case
when SIH.[Ship-to Code] = '' then (select C.Address from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])
end as addr,
case
when SIH.[Ship-to Code] = '' then (select C.[City] from [Customer] C where C.No_ = SIH.[Sell-to Customer No_])
end as city
from [Sales Invoice Header] SIH, [Port] P, [Country_Region] CR where No_ = 'PEXP1213-523' and P.Code = SIH.Port
and CR.Code = SIH.[Country of Final Destination]
union all
select P.[Port Name], CR.Name as country,
case
when SIH.[Ship-to Code] <> '' then (select C.Name from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])
end as name,
case
when SIH.[Ship-to Code] <> '' then (select C.[Address] from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])
end as addr,
case
when SIH.[Ship-to Code] <> '' then (select C.[City] from [Ship-to Address] C where C.Code = SIH.[Ship-to Code] and C.[Customer No_] = SIH.[Sell-to Customer No_])
end as city
from [Sales Invoice Header] SIH, [Port] P, [Country_Region] CR where No_ = 'PEXP1213-524' and P.Code = SIH.Port
and CR.Code = SIH.[Country of Final Destination]