update with subqueries possibilty [message #675810] |
Mon, 22 April 2019 01:43 |
shahzad-ul-hasan
Messages: 625 Registered: August 2002
|
Senior Member |
|
|
SQL> UPDATE STUDENT SET ADM_NO=
2 (select RANK() Over(ORDER BY doa) AS ADM_NO FROM STUDENT
3 where adm_clas not in ('SIX','SEVEN','EIGHT'))
4 WHERE EXISTS
5 (select RANK() Over(ORDER BY doa) AS ADM_NO FROM STUDENT
6 where adm_clas not in ('SIX','SEVEN','EIGHT'));
(select RANK() Over(ORDER BY doa) AS ADM_NO FROM STUDENT
*
ERROR at line 2:
ORA-01427: single-row subquery returns more than one row
SQL> UPDATE STUDENT SET ADM_NO=
2 (select RANK() Over(ORDER BY doa) AS ADM_NO FROM STUDENT
3 where adm_clas not in ('SIX','SEVEN','EIGHT'));
(select RANK() Over(ORDER BY doa) AS ADM_NO FROM STUDENT
*
ERROR at line 2:
ORA-01427: single-row subquery returns more than one row
please sort out this query;
|
|
|
|
|