Results 1 to 2 of 2

Thread: One to many

  1. #1
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Unanswered: One to many

    There is a table ‘T’ with order ids (‘oi’) and customer ids (‘ci’). Each order only belongs to a single customer and each customer may have multiple orders. How do you find how many orders each customer has? Please provide the SQL.


    select count oi.orders ids
    from table 'T'
    where , ci.customer ids = , oi.irder ids

  2. #2
    Join Date
    Apr 2003
    Location
    Israel
    Posts
    81
    select
    ci,
    count(oi)
    from T
    group by ci
    --
    kukuk

Posting Permissions

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