Created
April 19, 2015 04:25
-
-
Save thjanssen/fb8a1703de6d6d94e0a9 to your computer and use it in GitHub Desktop.
Result Set Mapping: Complex Mappings (http://www.thoughts-on-java.org/2015/04/result-set-mapping-complex.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.id, a.firstName, a.lastName, a.version, count(b.id) as bookCount FROM Book b JOIN Author a ON b.author_id = a.id GROUP BY a.id, a.firstName, a.lastName, a.version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment