ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  SQL Subqueries
Subject:   multiple updates in a single query
Date:   2002-11-14 00:57:59
From:   anonymous2
hi,
it was really a nice article. I have a question.
I a trying to update multiple entries with a single update statement. But my nth update is dependent on n-1th update. LEt us take an example.


lets say the query being executed is


update tbl set id = max(id) +1 where id < -9.


So in this, my last set id call will change the max(id).
On execution this query throws some exception ora-00934 saying group function is not allowed here.
can this type of updates be done? or is my query wrong?


Regards
A. Bansal


1 to 1 of 1
  1. excercises on sql
    2003-04-04 01:53:16  anonymous2 [View]

1 to 1 of 1