Results 1 to 3 of 3

Thread: Query help

  1. #1
    Join Date
    Oct 2003
    Location
    Toronto
    Posts
    5

    Unanswered: Query help

    We have two tables

    Table Customer:
    Customer_id Customer_name

    Table account:

    Account_no customer_id balance

    How to list all customers(by names) that have more than$1000 in total combined on all their account.

    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    select customer_id
         , customer_name
      from Customer
    inner
      join Account
        on Customer.customer_id = Account.customer_id
    group
        by customer_id
        , customer_name
    having sum(balance) > 1000
    added id to grouping, in case several customers have same name

    rudy
    http://r937.com/

  3. #3
    Join Date
    Oct 2003
    Location
    Toronto
    Posts
    5

    Thank a million

    Originally posted by r937
    Code:
    select customer_id
         , customer_name
      from Customer
    inner
      join Account
        on Customer.customer_id = Account.customer_id
    group
        by customer_id
        , customer_name
    having sum(balance) > 1000
    added id to grouping, in case several customers have same name

    rudy
    http://r937.com/
    Hi Rudy,

    Thank a million

    Blair

Posting Permissions

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