首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

2012-01-16 
下面sql语句写成一句,在线等,高手指教Sql_Wselect a.SupplierID from Workers as a,[User] as b where a

下面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 &"'"

热点排行