Backboards: 
Posts: 156
In response to "Yeah, that was the route I was thinking. My brain is full, I think." by JaxSean

I concur completely. Here's something that might be close to what you need,

but I can't test it so I don't know if it's syntactically or logically valid - plus, it also varies by the exact DBMS you're using.

SELECT name, id,
(
SELECT
temp_t1.num
FROM
t1 AS temp_t1
WHERE
temp_t1.id = t1.id
ORDER BY
temp_t1.date DESC
LIMIT 1
) as temp_num,
final_t1.*
FROM t1
JOIN t1 AS final_t1 ON final_t1.num=temp_num
GROUP BY name, id, final_t1.*


Post a message   top
Replies are disabled on threads older than 7 days.