Help for beginner on Chapter 5
Hello all,
I'm new to SQL Server 2000 and I'm reading through Vieira's Book.
At pag 121 I tried to do the exercice about authors and titles. I tried to do it with what I learnt in the previous pages but I cannot solve the problem.
Could anyone run the query I wrote in the pubs demo database and tell me whats wrong?
Thanks!!!
My Query
USE pubs
DECLARE @MyTitle Table
(
au_id text,
Title text
)
INSERT INTO @MyTitle
SELECT titleauthor.au_id, Titles.Title
FROM titleauthor
INNER JOIN Titles
ON titleauthor.title_id = Titles.title_id
--SELECT * from @MyTitle
SELECT authors.au_lname, @MyTitle.Title
FROM authors
INNER JOIN @MyTitle
ON authors.au_id = @MyTitle.au_id
|