Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Wink Unanswered: values from two table

    I have 2 tables vehicle and worker.
    number of workers under a vehicle mau be 10 or 25.
    vehicle(veh_id(pimary key),vehicle name, details)
    worker(work_id(pimary key),veh_id(foreign key),worker name)
    i have to list all records from vehicle table and to count how many workers exists under a vehicle.
    if no workers under a vehicle indicate 0.

    what i need is that It should be with asingle query.

    i have to list all date from vehicle table and to list how many workers under a vehicle(i mean count the workers)???

    Last edited by fernandodonster; 08-25-09 at 02:56.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by fernandodonster
    what i need is that It should be with asingle query.[/B]
    hint: LEFT OUTER JOIN

    (we do not do homework assignments on this site, but we will help you as you do the work)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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