Home » SQL & PL/SQL » SQL & PL/SQL » I need help in this query (merged)
I need help in this query (merged) [message #383320] Wed, 28 January 2009 05:11 Go to next message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
I have report for the bookstore and the auditor need to know the qty and the total sold books the problem with my query is the books is related to the courses so two difrrent college with diffrent course name have one book

for example

clg :Applied Studies

isbn tile qty qty sold course no
0070170525 book1 1 3 ETD280
clg : Engineering

isbn tile qty qty sold course no
0070170525 book1 1 3 ETDA280


i cant get rid of courses couse he want the courses

i dont want duplicat qty for the same book

any idea pls help
this is my query

Select DptEngDsc, BokCde, BokTtl, 
BokQty+(Select Nvl(Sum(ExpQtyRmn),0) From kExpBokT Where ExpBok = BokCde) qty,
(Select Nvl(Sum(RcpDtlQty),0) From KRcpDtlT Where RcpDtlBok = BokCde) pay,

c.CRSINLABV||a.crsnbr crsabv

From KBokBscT, rgsdba.PDptCdeT, rgsdba.RCrsCdeT a,  KCrsBokT b,rgsdba.RCrsInlT c

Where CrsBok = BokCde
And CrsInl = a.CrsInlCde
and crsinl = c.crsinlcde
And a.CrsNbr = b.CrsNbr
And CrsClgCde = DptCde
Order By BokCde
Re: help in his code [message #383323 is a reply to message #383320] Wed, 28 January 2009 05:23 Go to previous messageGo to next message
pv_snp
Messages: 11
Registered: July 2007
Location: INDIA
Junior Member

Post the output of the query

Thanks

Pardeep Sharma
Re: I need help in this query (merged) [message #383327 is a reply to message #383320] Wed, 28 January 2009 05:33 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost your questions.
If you have any problem refresh the forum BEFORE reposting.

Regards
Michel
Re: I need help in this query (merged) [message #383546 is a reply to message #383320] Thu, 29 January 2009 02:38 Go to previous message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
the output is attached i need only one book to apear even if it has two courses doesnt matter which one i want actual quantity not to be repeated


  • Attachment: output.txt
    (Size: 0.22KB, Downloaded 100 times)
Previous Topic: Cache vs Nocache of Sequences
Next Topic: Urgent: Trigger updating the table itself on which trigger is written
Goto Forum:
  


Current Time: Fri Dec 02 20:29:14 CST 2016

Total time taken to generate the page: 0.09959 seconds