Postgres : Select items for an interval from the max date in store
Editing your last query to the solution:

select * 
from items_prices 
where date_item &gt;= ( SELECT MAX(date_item) - interval '30 day' 
                     FROM items_prices 
                     where item_id = 3232 )
  and item_id = 3232;


The subquery can be moved to CTE:

WITH cte AS ( SELECT MAX(date_item) - interval '30 day' lastday
              FROM items_prices 
              where item_id = 3232 )
select items_prices.* 
from items_prices, cte
where items_prices.date_item &gt;= cte.lastday
  and items_prices.item_id = 3232;


or (to select last records for more than one item_id, maybe all)

WITH cte AS ( SELECT item_id, MAX(date_item) - interval '30 day' lastday
              FROM items_prices )
select items_prices.* 
from items_prices, cte
where items_prices.date_item &gt;= cte.lastday
  and items_prices.item_id = cte.item_id
--  and items_prices.item_id = (one item_id value, for example, 3232)
--  and items_prices.item_id IN (item_id list, for example, 3232, 3233)
--  none for all item_id
;