sql - MySQL find authors without posts (one-to-many relationship) -
I have a MySQL problem:
I have two tables (posts and authors) from one Many relationships (because each post is written by the author and one writer can write many posts).
Then there are tables:
Author: id: BIGINT, Name:
How do I get all the authors with any post?
What I am trying to do is is:
Select not from author, where not in (select author;
But this is taking ages!
There are 300,000 writers and 1,000,000 posts in two tables!
Any faster way?
Thanks guys
See this question:
The answer must be the same. / P>
Also, make sure that your ID and the Author_ID are indexed.
Comments
Post a Comment