Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: bookmarks and keywords

From: Sebastian Mendel <lists(at)sebastianmendel.de>
Date: Mon Sep 24 2007 - 10:25:07 EDT


Baron Schwartz schrieb:

> Hi Kevin,
> 
> Kevin Waterson wrote:

>> I have a table of bookmarks that have keyword searching.
>> Fields
>>
>> +-------------+----------------------+--------------------------+------------------+
>>
>> | bookmark_id | bookmark_title | bookmark_url |
>> bookmark_keyword |
>> +-------------+----------------------+--------------------------+------------------+
>>
>> | 1 | number one | http://www.phpro.org |
>> php |
>> | 2 | number 2 | http://www.freshmeat.net |
>> software |
>> | 3 | three here | http://www.php.net |
>> php |
>> | 4 | and four | http://www.redhat.com |
>> linux |
>> | 5 | the fifth | http://www.ez.no |
>> php |
>> | 6 | this will do | http://www.google.com |
>> search |
>> | 7 | something about fish | http://www.youtube.com |
>> linux |
>> | 8 | finally | http://www.redhat.com |
>> php |
>> +-------------+----------------------+--------------------------+------------------+
>>
>>
>> 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.

no, it is not

shouldn't it read:

SELECT

	child.bookmark_id,
	child.bookmark_title,
	child.bookmark_url
FROM
	bookmarks AS parent
join
	bookmarks AS child
ON
	parent.bookmark_keyword = child.bookmark_keyword
WHERE
	parent.bookmark_url = '
http://www.redhat.com'
GROUP BY
	child.bookmark_id;

???

-- 
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 Mon Sep 24 10:23:33 2007

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


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