I come from Oracle as well. If you can't go with a primary key then a count might work for you. Something like:

SELECT CASE WHEN count(1)=0 THEN 0 ELSE count(1)-1 END
FROM ......

(This is just a sample not applicable to your code). Maybe this gets you into the right direction.

Kind Regards,
Nitai

On Sep 24, 2008, at 10:25 PM, Thomas Mueller wrote:


Hi,

Update test_table set Name='Akshay' where rownum() = 5 - Does Not Work
Update test_table set Name='Akshay' where rownum = 5 - Does Not Work
while
Update test_table set Name='Akshay' where rownum() = 1 - Works

Am I doing the right thing ? Is there an Alternate Statement ?

This is a problem of ROWNUM and also exists in Oracle. See:
http://archives.postgresql.org/pgsql-general/2001-07/msg01257.php

You need to use another key. The best solution is to use the primary key:

Update test_table set Name='Akshay' where ID = 5

Regards,
Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---


--
Roozani - memorize everywhere
http://www.roozani.com/

Razuna - Open Source Digital Asset Management with Web Content Management
http://www.razuna.com/

SixSigns - Enrich people’s lives and web experience
http://www.sixsigns.com
http://blog.sixsigns.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to