#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Location
    Texas
    Posts
    354
    Rep Power
    7

    Single-row subquery returns more than one row


    I can't seem to wrap my head around this problem I'm having with a query. I need to update all rows in my ps_ntsr_gf_stufile tables with the concatenated values from the ps_classes_tbl table where a.CLASS_NBR = b.CLASS_NBR. I tried to limit it to emplid from the ps_stdnt_enrl table but no luck.


    PHP Code:
     UPDATE ps_ntsr_gf_stufile a
        SET a
    .CLASS_NAME = (SELECT CONCAT('SUBJECT''CATALOG_NBR')
        
    FROM PS_CLASS_TBL b
          WHERE a
    .CLASS_NBR b.CLASS_NBR
          
    AND a.STRM '1118'
          
    AND a.INSTITUTION 'NT752')
          
    WHERE a.EMPLID IN (SELECT distinct EMPLID FROM PS_STDNT_ENRL); 
    I'm still getting the ORA-01427 error.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    853
    Rep Power
    387

    Wink


    Originally Posted by SFDonovan
    I can't seem to wrap my head around this problem I'm having with a query.
    ... Etc ...
    I'm still getting the ORA-01427 error.
    This may be the oldest and most common Oracle error.

    Check it out here .

IMN logo majestic logo threadwatch logo seochat tools logo