I need to run a query like the following in HSQLDB:
delete from mytable where username = ? and password = ? and name = ? limit 1;
Essentially, I’d like to only delete one row from the database at most, provided that row matches my above criteria. Is this possible in HSQLDB?
Yes, try this:
The expression
rownum() <= nis also used to break down a huge delete or update into smaller chunks. For example deleting some 1000000 rows can be done in chunks of 100000 rows.