Women in Technology

Hear us Roar



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

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • excercises on sql
    2003-04-04 01:53:16  anonymous2 [View]

    hi
    i want to have some exercises on sql so that i can evaluate my understanding of sql concepts
    e-mail npaharia@rediff.com