All pastes #592487 Raw Edit

Something

public text v1 · immutable
#592487 ·published 2007-06-27 19:56 UTC
rendered paste body
LastLogin.find_by_sql "DELETE FROM last_logins WHERE date < (SELECT date FROM last_logins ORDER BY 
date DESC OFFSET 4 LIMIT 1)"

\d last_logins
                                    Table "public.last_logins"
 Column  |            Type             |                        Modifiers                         
---------+-----------------------------+----------------------------------------------------------
 user_id | integer                     | 
 date    | timestamp without time zone | default now()
 id      | integer                     | not null default nextval('last_logins_id_seq'::regclass)
Indexes:
    "last_logins_pkey" PRIMARY KEY, btree (id)