|
Posted by J.O. Aho on 02/23/06 18:26
Piotr Chmielewski wrote:
> I've got some lexicon-like application which stores data in 2 tables:
> lexicon( id, description ) and keywords(lexicon_id, keyword)
> This is flexible solution because there may be many keywords
> for one description. My problem is how to make ONE query, that
> will return description with given id, along with ALL keywords
> referencing to this description (keywords of course joined in
> one string, separated by a space or comma or any other character)
> Is it possible to achieve using MySQL 5? Maybe some subquery?
> I'll be grateful for any answer.
Do a select on keywords.keyword and left join lexicon
http://dev.mysql.com/doc/refman/5.0/en/join.html
//Aho
Navigation:
[Reply to this message]
|