Thanks - and with a little reading of the manpages, understandable too.... Appreciate it.
On Wed, Jun 1, 2011 at 2:34 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > On 6/1/2011 5:23 PM, Jim Mellander wrote: >> I appreciate the help - I'm new at using triggers. What I want to >> accomplish is: >> >> 1. insert if the ip isn't already in the database >> 2. update the timestamp if the new timestamp after the current >> timestamp in the database > > Something like this, perhaps: > > insert or replace into ip_timestamps values(:ip, > max(:timestamp, coalesce((select timestamp from ip_timestamps where > ip = :ip), 0)) > ); > > No trigger needed. > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users