home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,519 of 2,288   
   Mark to All   
   Need help with an SQL query   
   22 Jun 04 18:55:49   
   
   From: nospam@spamfree.org   
      
   (Using Oracle 8)   
      
   I have 4 tables, which I describe below: CUSTOMERS, BOOKS, ORDERS,   
   ORDERITEMS. These should be pretty self-explanatory, although in case you're   
   wondering ORDERITEMS constitutes X copies of one book that is part of an   
   order. Here are the important fields for this problem listings:   
      
   CUSTOMERS: CUSTOMER#, LASTNAME, FIRSTNAME   
      
   BOOKS: ISBN, RETAIL (company's selling price)   
      
   ORDERS: ORDER#, CUSTOMER#   
      
   ORDERITEMS: ORDER#, ITEM#, ISBN, QUANTITY   
      
   I need some way to calculate the sum of all books in a given order.   
   Basically, this requires taking (retail * quantity) for every order item in   
   an order and then adding those values up. I know how to use SUM and all   
   that, but I am having trouble because of how spread out all these values   
   are.   
      
   Anybody able to help me out? If my description confuses you, I'll be glad to   
   try to explain it better.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca