About SQL JOINS
I think sql JOINs can not be always avoided.
Let's take a very basic, well known example: storing authors and blog posts in a db. If we create two tables:
authors <br/> * authorid<br/> * fullname<br/>
and
posts<br/> * postid<br/> * authorid<br/> * title<br/> * text<br/>
When we want to show the list of posts and their authors we can do a JOIN like this:
SELECT authors.author_id, authors.full_name, posts.title, posts.text FROM posts JOIN authors ON authors.author_id = posts.author_id
How should we avoid the JOIN in this simple scenario?
Can you give some concrete examples with avoiding JOINS, and how to avoid them?
Cheers
About SQL JOINS
I think sql JOINs can not be always avoided.
Let's take a very basic, well known example: storing authors and blog posts in a db.
If we create two tables:
authors <br/>
* authorid<br/>
* fullname<br/>
and
posts<br/>
* postid<br/>
* authorid<br/>
* title<br/>
* text<br/>
When we want to show the list of posts and their authors we can do a JOIN like this:
SELECT authors.author_id, authors.full_name, posts.title, posts.text FROM posts JOIN authors ON authors.author_id = posts.author_id
How should we avoid the JOIN in this simple scenario?
Can you give some concrete examples with avoiding JOINS, and how to avoid them?
Cheers