I have a table that looks like this:
Code:
comment_id(int)|timestamp(timestamp)|comment(varchar)
I want to extract the latest comment whose comment column matches 'Include:%/%'
so if I have:
Code:
1 2009-10-15 23:21:18 Include:\ndir1/dir2/file1.java
2 2009-10-15 23:18:21 blah
3 2009-10-15 23:22:15 Include:\ndir1/dir2/file2.java
4 2009-10-15 23:18:53 dir1/dir2/dir3/file3.java
5 2009-10-15 23:19:24 blah blah
the query should return comment 3. I tried SELECT comment FROM comments WHERE timestamp=MAX(timestamp) GROUP BY 'Include:%/%' and it didn't work.