读书人

怎么根据一个表的内容对另一个表进行排

发布时间: 2012-09-14 11:53:44 作者: rapoo

如何根据一个表的内容对另一个表进行排序
现在有两个表
一个表为Product ,下有两个字段 Name FactureID
其中Name 为 string类型
FactureID 为 int 类型

另一个表为 Facture ,下面有两个字段 FactureName,FactureID
其中FactureName为 string类型
FactureID 为 int 类型

表Product的FactureID 和 表Facture 的FactureID 是对应的

现在想根据表Facture 中的FactureName 对表Product 进行排序
该如何使用SQL语句或者别的方法呢?
谢谢!

[解决办法]
select a.* from Product a left join Facture b on a.FactureID = b.FactureID
order by b.FactureName

读书人网 >SQL Server

热点推荐