postgreSQL_def/view/create_view_public.author_documents.sql

21 lines
444 B
SQL

-- View: public.author_documents
-- DROP VIEW public.author_documents;
CREATE OR REPLACE VIEW public.author_documents
AS
SELECT a.name AS author_name,
a.email,
dd.doc_id,
dd.title,
dd.type_name,
dd.content,
dd.updated_at
FROM authors a
JOIN document_authors da ON a.author_id = da.author_id
JOIN document_details dd ON da.doc_id = dd.doc_id;
ALTER TABLE public.author_documents
OWNER TO dbuser01;