Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Posts
    8

    Unanswered: Do I need to peform a nested sql querie?

    http://i50.tinypic.com/18dqfp.png

    At first I tried this:

    SELECT customer-name, loan-number, amount FROM borrower, loan WHERE amount > 0;


    But I know it's wrong I know I have to select data from multiple tables but not sure how the syntax goes.

  2. #2
    Join Date
    Apr 2012
    Posts
    213
    Try:

    Code:
    select b.customer-name, b.loan-number, l.amount
    from borrower as b
    join loan as l on l.loan-number = b.loan-number
    where l.amount > 0
    Hope this helps.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ANSI SQL requires identifier delimiters for column names containing special characters

    so...
    Code:
    SELECT b."customer-name", b."loan-number", ...
    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
  •