Please Help with SQL Statement

From: Howard Neuwirth-Hirsch <neuwirth_at_nmti.com>
Date: 1995/06/27
Message-ID: <id.I24L1.S06_at_nmti.com>#1/1


I have two input tables:

LINEAR

ENTRY_NO     FACTOR    CONST
--------     ------    -----
   1           .875       1
   2          1.000       0
   3           .436      20
   4           .222       0
   5           .943     -15


RAWDATA

UID      CHAR_NO 
---      -------
CST          3
MUS          5
PUP          2

.
.

FINALDAT

NAME     SCALE     BIAS
----     -----     ----

CST
MUS
PUP
There is a one-to-one correspondence between the records in RAWDATA and FINALDAT, i.e. FINALDAT was built from RAWDATA. I now want to populate the bias column from RAWDATA and LINEAR. I have tried the following:

update FINALDAT set bias= (select CONST from LINEAR,RAWDATA,FINALDAT where (FINALDAT.NAME = RAWDATA.UID and LINEAR.ENTRY_NO = RAWDATA.CHAR_NO));

the result of this is:

update FINALDAT set bias= (select CONST from LINEAR,RAWDATA,FINALDAT

                           *

ERROR at line 1:
ORA-01427: single-row subquery returns more than one row

Any suggestions?

Howard Neuwirth-Hirsch
neuwirth_at_nmti.com

-- 
Howard Neuwirth-Hirsch
neuwirth_at_nmti.com
Received on Tue Jun 27 1995 - 00:00:00 CEST

Original text of this message