create view

This commit is contained in:
uPagge 2021-03-08 18:45:21 +03:00
parent 66b87d8014
commit 3f1a6dc23c
No known key found for this signature in database
GPG Key ID: 964B40928E4C9088

View File

@ -35,4 +35,15 @@
referencedTableName="person" referencedColumnNames="id" onUpdate="CASCADE"/> referencedTableName="person" referencedColumnNames="id" onUpdate="CASCADE"/>
</changeSet> </changeSet>
<changeSet id="create-view-book-author" author="uPagge">
<createView viewName="author_and_book">
SELECT p.id as person_id,
p.name as person_name,
b.id as book_id,
b.name as book_name
FROM person p
LEFT JOIN book b on p.id = b.author_id
</createView>
</changeSet>
</databaseChangeLog> </databaseChangeLog>