Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511

    Unanswered: Subqueries to Return Multiple Calculations

    Using SQL+, I am trying to produce calculations as in the following example fields of STATE, COUNTY, RETAIL BUSINESS, REVENUE:

    CA, SONOMA, MCDONALDS, 10000
    CA, NAPA, MCDONALDS, 10000
    CA, SONOMA, BURGERKING, 12000
    NV, NEVADA, MCDONALDS, 16000
    ...

    I need to write a script that uses subqueries to display:
    CA 32000 SONOMA 22000 MCDONALDS 10000
    CA 32000 NAPA 10000 MCDONALDS 10000
    CA 32000 SONOMA 22000 BURGERKING 12000
    NV 16000 NEVADA 16000 MCDONALDS 16000

    I have searched but not found documentation on subqueries that will allow me to do this. Subqueries are required for this class assignment.

    Thanks.
    Jerry
    Last edited by JerryDal; 11-10-04 at 16:23.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Quote Originally Posted by JerryDal
    Using SQL+, I am trying to produce calculations as in the following example:

    CA, SONOMA, MCDONALDS, 10000

    from CA, 35,500,000, SONOMA,
    How do you arrive at "CA, SONOMA, MCDONALDS, 10000" from "CA, 35,500,000, SONOMA". I can see where the CA and SONOMA might come from, but where does the 10000 come from?
    Last edited by beilstwh; 11-10-04 at 16:24.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511
    I have edited a post that was inadvertently sent (prematurely). Please refer to the current posting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •