select count(*) from cr_revisions where item_id = :item_id select [join $attr_columns ", "] from [join $attr_tables ", "] where [join $column_id_cons " and "]