Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. person | version | date | created_at | data
  2. 1 | 1 | 01/01/2019 | 05/08/2019 | null
  3. 2 | 1 | 01/01/2019 | 05/08/2019 | null
  4. 1 | 1 | 02/01/2019 | 05/08/2019 | null
  5. 2 | 1 | 02/01/2019 | 05/08/2019 | null
  6. 1 | 2 | 01/01/2019 | 06/08/2019 | "some data"
  7. 1 | 3 | 01/01/2019 | 06/08/2019 | "some altered data"
  8. 1 | 3 | 01/01/2019 | 05/08/2019 | "also altered data"
  9.  
  10.  
  11.  
  12.  
  13. /*
  14. DESIRED RESULT
  15. I want to select the data for all different persons and dates at the highest versions and highest created at.
  16. It is possible for the same person, data and version to co-exists (the created at will never be the same in this case)
  17. */
  18.  
  19.  
  20. (person 1, date 01/01/2019, "some altered data")
  21. (person 1, date 02/01/2019, null)
  22. (person 2, date 01/01/2019, null)
  23. (person 2, date 02/01/2019, null)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement