I am trying to select a rows based on a Maximum value of a specific column value in SQL server 2008. I need to select the bookname and year based on the maximum edition.
Current table data:
BookName Year Edition
Latest Science 2013 1
Latest Science 2014 2
Latest Science 2015 3
Easy Maths 2014 1
Easy Maths 2015 2
Magic vs Logic 2015 1
Output should be:
BookName Year Edition
Latest Science 2015 3
Easy Maths 2015 2
Magic vs Logics 2015 1
I tried but it result only one rows of entire table
SELECT Book, year, edition
FROM Book_info
where edition=(select max(edition) from book_info)