Results 1 to 2 of 2

Thread: Help reg query

  1. #1
    Join Date
    Nov 2003
    Posts
    7

    Unanswered: Help reg query

    Guys,
    Here is the problem!!!

    SELECT Fld1 FROM SCHEMA1.TABLE1
    WHERE
    SCHEMA1.TABLE1.Fld1= (SELECT Fld2 FROM Schema2.TABLE2)

    The two tables belong to diff schemas.
    Imagine the sub-query is retrieving 20 records of Fld2 and passing them to Fld1. It gives an error which says that the query cannot be executed since the sub-query is returning multiple no. of records.
    Can any one help me out.....
    Thanks,
    Shiva.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SELECT Fld1 FROM SCHEMA1.TABLE1 ST1
    WHERE EXISTS (SELECT Fld2 FROM Schema2.TABLE2 ST2
    WHERE ST1.Fld1= ST2.Fld2 )

Posting Permissions

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