Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    27

    Unanswered: 'select ... where ... ' returns only one row

    Hi. When I execute the code below I get only one row returned, however actually there are more than one row that should be returned. If I replace column names with '*' to select all, it works fine, but i need to join additional table as you see.

    Code:
    SELECT Bills.ID, Bills.BillNumber, Vendors.Name, Bills.Date, Bills.DueDate, Bills.Amount, Bills.Description
    FROM Bills INNER JOIN Vendors ON Bills.ID = Vendors.ID WHERE Bills.Paid = 'False'
    thank you in advance.

  2. #2
    Join Date
    Jun 2009
    Posts
    66
    Bills.VendorId = Vendors.Id instead of Bills.Id = Vendors.Id

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    So you are saying that your posted SQL returns one row, but this returns how many rows?
    Code:
    SELECT *
    FROM Bills  INNER JOIN  Vendors  ON Bills.ID = Vendors.ID  WHERE Bills.Paid = 'False'
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2009
    Posts
    27
    sqlguru, thank you. the query is generated, i didn't see that.
    pootle flump, in that case the query returns all rows under that condition.
    problem solved. thank you!

Posting Permissions

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