Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Unanswered: Help w/ SubQuery

    Hello,
    Having trouble with a subquery, any clues greatly appreciated...
    __________________________________________ ___
    SELECT
    T1.account_id, T1.ship_kind, T1.ship_date, subQ1.pay_amount
    FROM tran T1,
    (SELECT B1.batch_number, B1.batch_seq, B1.account_id, B1.pay_amount
    FROM btch_det B1
    WHERE B1.batch_number = '4008asbc'
    AND B1.account_id = '821') subQ1,
    WHERE subQ1.account_id = T1.account_id

    Result: ORA-00903: invalid table name

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    <code>
    SELECT T1.account_id, T1.ship_kind, T1.ship_date, B1.pay_amount
    FROM tran T1, btch_det B1
    WHERE B1.batch_number = '4008asbc'
    AND B1.account_id = '821'
    AND b1.account_id = T1.account_id;
    </code>
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    Nevermind, it was the comma after the subquery pointer.

    AND B1.account_id = '821') subQ1,
    should have been
    AND B1.account_id = '821') subQ1
    ............................no comma ^^

Posting Permissions

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