One table. One query. Could you please help?I have a table called PROJECT. Projects can be baselined whereupon a copy is made in the table but this time with the original project name appended with a baseline number. I'll give you an example:PROJECTproj_id orig_proj_id proj_name1 null Project One2 null Project Two3 1 Project One - B14 1 Project One - B25 2 Project Two - B16 1 Project One - B3
I would like a query that returns the most recent baseline of each project, such as follows:RESULTproj_id orig_proj_id proj_name5 2 Project Two - B16 1 Project One - B3
Notes:* proj_id is primary key* No two projects will have the same name* The baseline numbering is consistent (B1, B2, B3, ... )* You CANNOT assume anything about the numbering of proj_id, just that it is a primary keyI was thinking of using something like SELECT TOP 1 * FROM PROJECT WHERE ??? ORDER BY PROJECT.proj_name DESC
but I am not sure.Any help greatly appreciated!