|
|
|
|
|
|
| Re: Delete using a CTE [message #630921 is a reply to message #630914] |
Tue, 06 January 2015 05:51   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Welcome to the forum!
Please read and follow the OraFAQ Forum Guide and How to use [code] tags, to enable us to help you.
system243trd wrote on Tue, 06 January 2015 16:21Is it possible to delete rows using a CTE
No. At least not the way you intend to do it. You could use the result set of the common table expression, but that would be unnecessary.
Why do you want to do it anyway?
|
|
|
|
| Re: Delete using a CTE [message #630922 is a reply to message #630920] |
Tue, 06 January 2015 05:55   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
system243trd wrote on Tue, 06 January 2015 17:15
Is it possible to do the following:
with cte (
select ..
...
..
)
delete (select rowid from table1)
No. You could do it as -
Delete from table where ....(<your CTE>)
But once again, why do you want to do it this way?
|
|
|
|
|
|
| Re: Delete using a CTE [message #630936 is a reply to message #630925] |
Tue, 06 January 2015 07:21  |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
I am not sure, but after google search it seems like the delete statement goes along CTE(subquery factoring) in MS SQL Server. Which is not the case in Oracle, where only a SELECT goes along with the expression.
Ed : oops missed MS SQL Server
[Updated on: Tue, 06 January 2015 07:25] Report message to a moderator
|
|
|
|