Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 15th, 2008, 05:33 AM
Authorized User
 
Join Date: Apr 2007
Location: Silvassa, Dadra & Nagar Haveli, India.
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multilevel subtotal of columns

In the below given query, i want to display the subtotal of the following columns
1)(PRI_QTY||'.'||PRI_QTY_LS)RMQTY,
2)(PRI_QTY_BU/IU_MAX_LOOSE_1)RQTY,
3)((PRI_QTY_BU/IU_MAX_LOOSE_1)*CGCV_COST_1)RMVALUE

Kindly suggest how could i do this?

SELECT DISTINCT PRWD_WO_NO PWO_NO,
PRI_ITEM_CODE,
ITEM_NAME,
(PRI_QTY
||'.'
||PRI_QTY_LS) RMQTY,
((PRI_QTY_BU / IU_MAX_LOOSE_1) * CGCV_COST_1) RMVALUE
FROM OT_PR_ITEM,
OS_COST_GROUP_CURR_VAL,
OM_ITEM,
OM_ITEM_UOM,
OT_PR_WO_DETAIL
WHERE PRI_ITEM_CODE = CGCV_ITEM_CODE
AND PRI_ITEM_CODE = ITEM_CODE
AND PRI_ITEM_CODE = IU_ITEM_CODE
AND PRWD_SYS_ID = PRI_PRWD_SYS_ID
AND CGCV_COST_GROUP_CODE = 'CGSIL001'
GROUP BY PRI_PRWD_SYS_ID,
PRWD_WO_NO,
PRI_ITEM_CODE,
ITEM_NAME,
CGCV_COST_1,
PRI_QTY,
PRI_QTY_LS,
PRI_QTY_BU,
IU_MAX_LOOSE_1
ORDER BY PRWD_WO_NO



Yogesh
__________________
Yogesh
Reply With Quote
  #2 (permalink)  
Old July 15th, 2008, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I don't understand how you could *EVER* get the total or subtotal of this column:
    (PRI_QTY||'.'||PRI_QTY_LS) as RMQTY

It's not a number. It's a string. You can't get the total of a text column.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtotal fields jsims Access 1 November 10th, 2008 11:34 AM
Subtotal yogeshyl SQL Language 1 July 15th, 2008 02:16 PM
Multilevel Grouping with XSLT 2.0 rzegwaard XSLT 2 January 9th, 2008 04:13 PM
Multilevel unlimited subcategory ? atul PHP Databases 0 September 22nd, 2007 12:37 AM
MultiLevel PHP babaloui PHP Databases 10 August 1st, 2004 02:44 AM



All times are GMT -4. The time now is 02:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.