According to this http://www.sqlite.org/lang_update.html you have
invalid syntax.
I believe you can achieve the same by this (assuming that id is unique
in fud28_thread):

UPDATE fud28_read
SET user_id=2, last_view=1244710953,
       msg_id=(SELECT last_post_id FROM fud28_thread
                     WHERE id = fud28_read.thread_id)
WHERE user_id=2
      AND thread_id in (SELECT id FROM fud28_thread
                                 WHERE forum_id=4 AND last_post_date > 0)


Pavel

On Thu, Jun 11, 2009 at 2:17 PM, Frank Naude<[email protected]> wrote:
> Hi,
>
> I need some help getting this UPDATE to work with sqlite 3.3.8:
>
> UPDATE fud28_read
> SET user_id=2, msg_id=t.last_post_id, last_view=1244710953
> FROM (SELECT id, last_post_id FROM fud28_thread WHERE forum_id=4 AND
> last_post_date > 0) t
> WHERE user_id=2 AND thread_id=t.id
>
> Error: near "FROM" - syntax error: HY000
>
> Does sqlite support  inline views/ derived tables within UPDATE
> statements? Any suggestions on how to get it to work?
>
> Best regards.
>
> Frank
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to