filter for last row in grouped data sets
-
Hello, I am trying to display the last entry for each property listed in a table. Can this be filtered in wpdatatables?
Not knowing how to do that I have been trying to modify the db query to import the last entry by property by grouping the property and selecting the highest id per group but I cannot get this query working either.
SELECT icomprealestatequickstats.id, icomprealestatequickstats.userid, icomprealestatequickstats.property, icomprealestatequickstats.pricedate, icomprealestatequickstats.listprice, icomprealestatequickstats.squarefeet, icomprealestatequickstats.squarefootprice, icomprealestatequickstats.numrooms, icomprealestatequickstats.numbedrooms, icomprealestatequickstats.numbathrooms, icomprealestatequickstats.locationrating FROM icomprealestatequickstats WHERE id, IN ( SELECT MAX(id) FROM icomprealestatequickstats GROUP BY property );
Hope you can help. The things I think should be simple……;) thnx!
- The topic ‘filter for last row in grouped data sets’ is closed to new replies.