> where rowid = (select min(rowid) from table1) Yes, that is also what I came up with but this is a bit tricky to add in code if there is where clause already (or even multiple where clauses when there are table joins) and I thought there might be some better method. I guess not. It would be useful if there was something like sqlite3_step1 just for this scenario.
RBS On Sun, Dec 11, 2016 at 9:47 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 12/11/2016 4:38 PM, Bart Smissaert wrote: > >> Say I have a UDF called AddOne in a statement like this: >> >> update table1 set field1 = AddOne(field1) >> >> and say the table table1 has some million rows. >> >> Now I want to test this statement to test the UDF but I want to do this >> for >> only one row. >> How do I do this? >> >> limit 1 only applies to data producing statements. Adding a where clause, >> say where >> rowid = 1 is a bit tricky (all this has to be done in code) and there may >> not be a rowid of 1 >> > > where rowid = (select min(rowid) from table1); > > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users