以下查询:
SELECT i.Item_ID
FROM AGR_Header ah
LEFT JOIN AGR_Detail ad
ON ad.AGR_Header_RecID = ah.AGR_Header_RecID
LEFT JOIN IV_Item i
ON i.IV_Item_RecID = ad.IV_Item_RecID
显示以下结果:
a4 black usage page count
a4 colour usage page count
a4 black usage page count
a4 colour usage page count
a4 black usage page count
a4 colour usage page count
a4 black usage page count
a4 colour usage page count
有没有办法为每个 Item_ID 创建一列,使其显示如下:
A4 Black A4 Colour
a4 black usage page count a4 colour usage page count
a4 black usage page count a4 colour usage page count
a4 black usage page count a4 colour usage page count
a4 black usage page count a4 colour usage page count
我已经阅读了有关使用 ROW_NUMBER 为每个 Item_ID 分配序列号或使用 PIVOT ...不熟悉这些或任何其他方式来完成此操作的信息,因此不胜感激。
干杯