I am trying to get all titles publishers and authors

时间:2016-11-12 06:03:14

标签: sql

I am trying to get all titles publishers and authors that are from 'NY' but the titles table don't have a state column and I have to use union/union all to get it also need to have a column return in front of the data return to show what table it came from

select au_lname + ', ' + au_fname as name
from authors a
where state = 'NY'

union all

select pub_name
from publishers p
where state = 'NY'

union

select title_name
from titles

0 个答案:

没有答案