This one time, at band camp, Baron Schwartz <[EMAIL PROTECTED]> wrote:

> > I wish to select all bookmark_title and bookmark_url that have the same 
> > keywords as
> > the bookmark_url 'http://www.redhat.com. I do this..
> > mysql> SELECT child.bookmark_id, child.bookmark_title, child.bookmark_url 
> > FROM bookmarks AS child join bookmarks AS parent ON parent.bookmark_keyword 
> > = child.bookmark_keyword WHERE child.bookmark_url='http://www.redhat.com' 
> > GROUP BY child.bookmark_keyword;
> > 
> 
> That query is right.

> > But this returns..
> > +-------------+----------------+-----------------------+
> > | bookmark_id | bookmark_title | bookmark_url          |
> > +-------------+----------------+-----------------------+
> > |           4 | and four       | http://www.redhat.com |
> > |           8 | finally        | http://www.redhat.com |
> > +-------------+----------------+-----------------------+
> 
> But, the JOIN table from which those columns come actually has the 
> columns you want from the parent table as well.  It's just that you're 
> selecting the child columns.

Im not sure I follow, the results should be those with id's of 1, 3, 4, 5, 6, 
7, 8

and If I chose http://www.php.net that has only the keyword of "php" then the 
results
would be 1,3,5, and 8

Kind regards
Kevin

-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to