My table has the following columns, |id|incident_number|created_at|note|
.
so each incident can have many updates, updates are categorized by ID, and are given a created_at
time in the form of 2014-01-30 21:11:56
. So one incident_number
can have many id's and many created_at's depending on how often it is being updated.
What I am trying to do is filter out all of the other created_at
's by the most recent one in correspondence to time.
The catch is, is when running the query i cant look at the data and say if the created_at is less than this given date because I am unsure of when these incidents have been worked on.
big picture is I will be able to show each incident with the most recent update, sorted by the created_at
date.
Any suggestions?