Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: bookmarks and keywords

From: Sebastian Mendel <lists(at)sebastianmendel.de>
Date: Tue Sep 25 2007 - 02:29:27 EDT


Baron Schwartz schrieb:

> SELECT parent.bookmark_url as pbu, parent.bookmark_keyword as pbk
> FROM bookmarks AS child
> JOIN bookmarks AS parent
> ON parent.bookmark_keyword = child.bookmark_keyword
> WHERE child.bookmark_url='http://www.redhat.com';
>
> [..]

no, you didn't, you just switched the names ... :-/

but from his original point of view the row with the given URL was his parent and he wants to have all childs (identified by the same keywords) - now you have just switched the names - making the childs his parents and the parents his childs - this is confusing

just tell him: first the table which 'filters':

FROM parent WHERE ...

than the table he wants to select from:

SELECT ... FROM child

Do you need help?X

and now join them on the identifying field:

SELECT child....
FROM parent
JOIN child
USING (keyword)
WHERE parent...

-- 
Sebastian

-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Tue Sep 25 02:27:53 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:11:58 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library