RE: [PHP-DB] Delicious style Tags table

From: Date: Fri, 03 Oct 2008 15:01:35 +0000
Subject: RE: [PHP-DB] Delicious style Tags table
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-45503@lists.php.net to get a copy of this message
Simcha Younger-2 wrote: > > > I did a little testing, and this should work better: > > Select... > From... > group by taggings.id > HAVING GROUP_CONCAT('name') like 'soup' > AND GROUP_CONCAT('name') like 'vegetarian' > > Yep, that works also, just to clarify it needed %'s either side to work properly, e.g. SELECT GROUP_CONCAT( tags.name ) AS tags, taggings . * FROM tags LEFT JOIN taggings ON ( tags.id = taggings.tag_id ) GROUP BY taggings.taggable_id HAVING GROUP_CONCAT( tags.name ) LIKE '%soup%' AND GROUP_CONCAT( tags.name ) LIKE '%vegetarian%' I'll do some testing when I get time on lots of tags and see which of the methods (I now have 3) is fastest. Thanks -- View this message in context: http://www.nabble.com/Delicious-style-Tags-table-tp19433010p19799558.html Sent from the Php - Database mailing list archive at Nabble.com.

« previous php.db (#45503) next »