in reply to (OT) Postgres Query
i can't think how to do it with your table schema in a single query, but i can at least offer a (admittedly kind of ugly) solution:
you could add a last_action column to the lb_objs table which you update everytime you insert or update the row. you could probably also define a trigger to automatically keep the lb_trans table up to date (avoiding having to do 2 update/inserts each time).
anders pearson // digital samurai personal // http://www.columbia.edu/~anders/ weblog // http://thraxil.dhs.org/
|
|---|