Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use LISTAGG in where condition

User_B9XGOJul 15 2017 — edited Jul 18 2017

Hi All,

I want to update table   temp_emp by passing values(employees) from a query that fetches multiple values.

Can anyone please help on how can I use LISTAGG in the where condition.

SELECT  LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees

FROM emp

where deptno = 10;

EMPLOYEES

--------------------------------------------------

CLARK,KING,MILLER

UPDATE temp_emp

set emp_status = 'new'

where empname = employees

Thanks.

This post has been answered by Stew Ashton on Jul 18 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2017
Added on Jul 15 2017
25 comments
9,976 views