Currently, I’m performing SQL queries that look something like this:

select id from books where author_id in
(select * from
((select 106 id) union all
(select id from compound_authors where author_id = 106))
as extended_authors);

I have a hard time believing that the select * from bit is really necessary, but I can’t find a way to get rid of it without introducing a syntax error. The lesson, I suppose, is that I should learn SQL syntax, but does anybody know the right way to write this?

Post Revisions:

There are no revisions for this post.