I have a CMS with a table of items, and another table serving as a log
of operations performed on the items. The revelent table structure is
as follows:
items
itm_id | usr_id_create | itm_date_create | usr_id_modify |
itm_date_modify | .
itm_id is a serial primary key.
usr_id_* are the keys
Howdy, Gordon.
This query is an attempt to replicate your items table with data just from
changelog table.
Could you please try it out?
Best,
Oliveiros
SELECT itm_id,usr_id_create, itm_date_create, usr_id_modify, itm_date_modify
FROM
(
SELECT a.itm_id, a.usr_id as usr_id_create, create as itm_d