Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2011
    Posts
    4

    Question Unanswered: Comparing Row Record In a column With all Others In

    I Want To Compare A Record In A Column From A Table With All Other Records In A Column From A Different Table.

    Here Is What I'm Trying To Do:

    SELECT Name FROM Physician WHERE EmployeeID IN (SELECT Physician FROM Undergoes WHERE UnderGoesDate >= ( SELECT CertificationExpires FROM Trained$In ));


    This Is The Error I Get:

    ORA-01427: single-row subquery returns more than one row

    Any Help On How To Fix This Or How Can I Do It.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    WHERE UnderGoesDate >= ( SELECT CertificationExpires FROM Trained$In ));
    either change SELECT to return only 1 row or change ">=" to be "LIKE"
    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
    Jun 2011
    Posts
    4
    Look I Want To Get All The Names Of Pysicians Who have performed a medical procedure they have never been certified to perform.

    so can u give me a solution please I am a student and totally new to this so please help me

  4. #4
    Join Date
    Jun 2011
    Posts
    4
    Please I Really Need Help If You Wand Any Other Info Just Tell Me What I Need To Do.

  5. #5
    Join Date
    Jun 2011
    Posts
    4
    What First Time For Me Here & No Body Can Answer Me

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Can't tell for sure, but - maybe you are missing a join condition, here:
    Code:
    from undergoes u
    where u.undergoesdate >= (select t.certification expires
                              from trained$in t
                              where t.physician_id = u.physician_id    --> this line
                             )
    It, most probably, doesn't look like this (but you might find how it should really look like).

    As of "other info" you mentioned: yes, test case could help. It includes CREATE TABLE and INSERT INTO several sample records. That would provide "input", so I wouldn't have to guess the "join condition".

    You should then explain what is desired output and why (OK, I presume you already did that).

    Finally, I hope that you realize that this is just a forum - a place where people gather. You ask a question. Someone, who sees it, has some time to spare, knowledge required to provide assistance, answers your question. There's no reason to be impatient. If you need an "urgent" help, go to your teacher (or, in "real" world, hire a consultant). Here, you get exactly what you paid for (you paid nothing, so - everything you get is more than welcome).

  7. #7
    Join Date
    Feb 2004
    Location
    Chennai
    Posts
    53
    u may wanna add an >=ALL , is that ur requirement
    -Mathan
    For a quick pocket reference of oracle refer http://pocketoracle.blogspot.com/

Tags for this Thread

Posting Permissions

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