当前位置: 代码迷 >> Sql Server >> 下面sql语句写成一句,高手指教
  详细解决方案

下面sql语句写成一句,高手指教

热度:12   发布时间:2016-04-27 18:41:33.0
下面sql语句写成一句,在线等,高手指教
Sql_W="select a.SupplierID from Workers as a,[User] as b where a.User_id=b.User_id and b.User_name='"& rs("User_name") &"' and b.User_pwd='"& User_pwd &"'"
Sql_S="Select SupplierID,Name,English_Name from Supplier where SupplierID="& SupplierID &""

这条两条sql我想写成一条,请高手出招!!谢谢

------解决方案--------------------
--try
Sql_S="Select SupplierID,Name,English_Name from Supplier where SupplierID in (select a.SupplierID from Workers as a,[User] as b where a.User_id=b.User_id and b.User_name='"& rs("User_name") &"' and b.User_pwd='"& User_pwd &"'"
  相关解决方案