-4
我有一個SQL case語句這樣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"
如何,如果我可以加載所有的case語句條件,如「新」,「合格」,‘註冊’和flowstatuses成組合框在vb.net?你能給我一個例子嗎?我試過這樣做了很長一段時間,感謝。
是否需要將這些狀態的單獨列表加載到組合框中?不是從這個查詢? –
我的意思是,會有2個組合框,每個組合框。對於地位,它將是「新的」,「合格的」,「列入黑名單」並被拒絕,而對於流量狀態,「審查中」,「潛在普通」和「潛在排他」。 –