Delete all levels of employees those who are under BLAKE? [message #612195] |
Mon, 14 April 2014 06:38 |
|
kiranrathodkr916
Messages: 36 Registered: March 2014 Location: India
|
Member |
|
|
Delete all levels of employees those who are under BLAKE?
my solution
[code]delete from emp where empno in( select empno from emp start with ename='BLAKE' connect by prior emp1no=mgr)[/code]
6 rows deleted
given soln
Delete emp1 where ename in(select ename from emp1 start with emp1no = (select emp1no from emp1 where ename='BLAKE')
connect by prior emp1no = mgr)
6 rows deleted
how my soln different from given soln.are they both same?
[Updated on: Mon, 14 April 2014 06:39] Report message to a moderator
|
|
|
|
Re: Delete all levels of employees those who are under BLAKE? [message #612197 is a reply to message #612195] |
Mon, 14 April 2014 06:56 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
kiranrathodkr916 wrote on Mon, 14 April 2014 17:08 how my soln different from given soln.are they both same?
What difference do you observe? Both would return same result. In your second query, there is an extra statement :
select emp1no from emp1 where ename='BLAKE'
Which could be simply replaced with And I see your 1st query is already doing that.
What's your actual concern?
|
|
|
|
|