sql server 视图(100分)

  • 主题发起人 主题发起人 fangwave
  • 开始时间 开始时间
F

fangwave

Unregistered / Unconfirmed
GUEST, unregistred user!
在注释中写 如果a.cino存在于t_outindata 就显示‘已入库’,没有就显示‘无’
SELECT A.CINO AS 单据编号,A.ITEM AS 物料编码,B.INAME AS 物料名称,D.UNITDES AS 单位,A.SUNO AS 供应商编码,C.NAME AS 供应商名称,
case A.TAG when 0 then
'仓库外协' when 1 then
'工作中心外协' end AS 类型
///
///
FROM dbo.T_col_ritem A LEFT OUTER JOIN
dbo.B_ITEM B ON A.ITEM = B.ITEM LEFT OUTER JOIN
dbo.B_SUPPLIER C ON A.SUNO = C.SUNO
where a.state=4
 
SELECT A.CINO AS 单据编号,A.ITEM AS 物料编码,B.INAME AS 物料名称,D.UNITDES AS 单位,A.SUNO AS 供应商编码,C.NAME AS 供应商名称,
case A.TAG when 0 then
'仓库外协' when 1 then
'工作中心外协' end AS 类型,
case when d.cino is not null then
'已入库' else
'入库' end as '入库情况'
FROM dbo.T_col_ritem A
LEFT OUTER JOIN
dbo.B_ITEM B ON A.ITEM = B.ITEM
LEFT OUTER JOIN
dbo.B_SUPPLIER C ON A.SUNO = C.SUNO
LEFT OUTER JOIN
dbo.t_outindata D on A.cino=D.cino
where a.state=4
 
接受答案了.
 
后退
顶部