如何创建单行到多行 [英] how to create single row to multiple row
本文介绍了如何创建单行到多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i有两张这样的桌子
产品表
ProductID Article_No SeriesId
1 SY000 1
4 SY001 3
3 SY001 2
<产品尺寸表
产品尺寸表
产品ID尺寸数量
4 2 5
4 5 8
4 8 15
如何选择输出表..就像这样。
ProductID Article_No SeriesId size数量
4 SY001 3 2 5
4 SY001 3 2 8
4 SY001 3 2 15
& lt; / pre& gt;< / pre>
如何创建查询
解决方案
使用此...
选择 Product.ProductID,Article_No,SeriesId,size,Quantity
fr om productsize
left join
product on product.ProductID = productsize.ProductID
Happy Coding!
:)
dear all,
i have a two table like this
product table
ProductID Article_No SeriesId 1 SY000 1 4 SY001 3 3 SY001 2
productsize table
ProductID Size Quantity 4 2 5 4 5 8 4 8 15
how to select out put table.. like this.
ProductID Article_No SeriesId size Quantity 4 SY001 3 2 5 4 SY001 3 2 8 4 SY001 3 2 15 </pre></pre>
how to create query
解决方案
use this...
select Product.ProductID,Article_No,SeriesId,size,Quantity from productsize left join product on product.ProductID= productsize.ProductID
Happy Coding!
:)
这篇关于如何创建单行到多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文