Help for this page

Select Code to Download


  1. or download this
    SELECT DISTINCT ON (id) id, description
    FROM list_index li
    ORDER BY id, rpt_key DESC;
    
  2. or download this
    SELECT DISTINCT id,
        (SELECT description from list_index li_i
         WHERE li_i.id = li_o.id
         ORDER BY created_at DESC limit 1) AS description
        FROM list_index li_o;
    
  3. or download this
    SELECT id,
        (SELECT description from list_index li_i
    ...
         ORDER BY created_at DESC limit 1) AS description
        FROM
            (SELECT DISTINCT id FROM list_index) li_o;