Re: [sqlite] UPDATE question

2011-10-18 Thread Barry1337
Igor Tandetnik wrote: > > Barry1337 <jmichiels...@gmail.com> wrote: >> So I need, for every record in STAYSPEC, to find another record in >> STAYSPEC >> that has the same STAYNUM field and an ORDER_SPEC field that is 1 more. I >> want to replace the d

[sqlite] UPDATE question

2011-10-18 Thread Barry1337
I have the following query: Code: UPDATE STAYSPEC SET date_out = CASE WHEN EXISTS (SELECT * FROM STAYSPEC AS STAYSPEC2 WHERE (STAYSPEC2.STAYNUM = STAYSPEC.STAYNUM) AND (STAYSPEC2.ORDER_SPEC = STAYSPEC.ORDER_SPEC+1)) THEN (SELECT date_in FROM STAYSPEC AS