【发布时间】:2012-12-24 07:29:29
【问题描述】:
我有一个这样的 sql case 语句
select Distinct y.SupplierID,y.Name,y.AddWho ,
"StatusDesc=CASE when y.status='N' then 'NEW' " & _
"when y.status='B' then 'BLACKLISTED'" & _
"when y.status='Q' then 'QUALIFIED'" & _
"when y.status='R' then 'REJECTED' end , " & _
"FlowStatusDesc = CASE when y.flowstatus='RC' then 'UNDER REVIEW'" & _
"when y.flowstatus='PE' then 'POTENTIAL EXCLUSIVE'" & _
"when y.flowstatus='PO' then 'POTENTIAL ORDINARY' ELSE '' end," & _
"OrderNo=case when y.status='N' and flowstatus='' then '1'" & _
"when y.status='N' and y.flowstatus<>'' then '2' " & _
"when y.status='R' and y.flowstatus='' then '3'" & _
"when y.status='R' and y.flowstatus<>'' then '4'" & _
"when y.status='Q' and y.flowstatus='' then '5'" & _
"when y.status='Q' and y.flowstatus<>'' then '6'" & _
"when y.status='B' and y.flowstatus='' then '7'" & _
"when y.status='B' and y.flowstatus<>'' then '8' else '9' end " & _
"from AP_Supplier y" & _
" left outer join SC_User u on y.addwho=u.userid " & _
"left outer join SC_Company co on co.companycode=u.companycode " & _
"where flowstatus is not null " & _
"group by y.SupplierID,y.name,y.status,y.flowstatus,y.addwho " & _
"order by orderno"
如果我可以将“新”、“合格”、“注册”和 flowstatuses 等所有案例语句条件加载到 vb.net 上的组合框中?你能给我举个例子吗?我试过这样做很长一段时间。谢谢。
【问题讨论】:
-
您希望将这些状态的单独列表加载到组合框中吗?不是来自这个查询?
-
我的意思是,会有 2 个组合框,每个组合框。对于状态,它将是“新”、“合格”、“黑名单”和拒绝,而对于流状态,“正在审查”、“潜在普通”和“潜在独家”。
标签: c# .net sql-server