title: How to select distinct records based on multiple row values?
body: <p>I have a table </p>
  
  <pre><code>CREATE TABLE event
    uuid character varying(50),
    created timestamp without time zone DEFAULT now(),
    event_type character varying(50))
  </code></pre>
  
  <p>And the data is like this</p>
  
  <p><a href="https://i.stack.imgur.com/ysRCW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ysRCW.png" alt="enter image description here"></a></p>
  
  <p>I need to fetch the latest event_type that is 'NotSaved' or 'Saved' per uuid 
  Like in this case uuid_1234, Saved and uuid_1235, NotSaved.
  I tried with distinct, subquery and max but didn't give correct result</p>