title: How to select users for whom one type of event occurred before another in PostgreSQL?
body: <p><a href="https://i.stack.imgur.com/Cfz1w.png" rel="nofollow noreferrer">this is an example of data structure in my SQL table</a></p>
  <p>In fact I have many users in my table and some of them have incorrect order of steps (user number 2 in the picture). How can I select all such users? The logic is to select all users that have date of sign_in earlier than date of registration? I suppose regular WHERE clause won't work here. Maybe there is a special function for such cases?</p>