存储过程中的两个select语句

时间:2013-03-18 10:19:53

标签: sql sql-server-2008

我在SQL Server 2008中有两个表:

  • Customercustomerid, customername(仅包含一行)

  • Productproductid, productname, category, price(包含多行)

我希望在单个存储过程中使用2个select语句从customername表和customerproductname,category,price表中获取product

怎么做?

1 个答案:

答案 0 :(得分:1)

使用临时表(#temp)概念可以做到这一点。最好的方法是在两个表和写连接查询之间建立关系。

相关问题