开发者

Want SQL Query to display Data from Row into Column

开发者 https://www.devze.com 2023-03-15 15:05 出处:网络
Is there is any SQL statement to generate this report? Original Data In table (Quotation Analysis Detail)

Is there is any SQL statement to generate this report?

Original Data In table (Quotation Analysis Detail)
-----------------------

Doc_No  Doc_Date    Item_ID     Qty   Rate  BAsic_Amount  Net_Amount  Supplier_ID
1       2011/06/23  520720E    10     123    1230          1230           1
1       2011/06/23  520开发者_JS百科720E    10     345    3450          3450           18

I need to display data in Crystal Report as below format (Cross Tab Not working). Need SQL statement

              |  Supplier ID's |
-------------------------------------------------
              1       |       18      and so on
------------------------------------------------
QTY          10       |      10
Rate         123      |      345
Basic_Amount 1230     |      3450
Net_Amount   1230     |       3450

. . . and so on.


What you are actually trying to do is to UNPIVOT a table... You already have in a normalized mode, but want them columnar per each supplier for like a side-by-side comparison and each column... you would also have to have a "definitive" number of suppliers you wanted to compare which would get into a VERY ugly / long SQL command... It COULD be done, but QUITE ugly...

Is this your intent??? and if so, would you be supplying a specific list of suppliers you wanted in a side-by-side comparison?

0

精彩评论

暂无评论...
验证码 换一张
取 消