You are here: Re: Joining many results from one table with one result from another in one query « PHP SQL « IT news, forums, messages
Re: Joining many results from one table with one result from another in one query

Posted by Piotr Chmielewski on 02/23/06 20:41

Uzytkownik "J.O. Aho" <user@example.net> napisal w wiadomosci news:46661nF9mkohU1@individual.net...
> Do a select on keywords.keyword and left join lexicon
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
Still I dont know how to extract ALL keywords linked to one description
in just one query... Lets say we have:
CREATE TABLE `keywords` (
`lexicon_id` int(11) NOT NULL default '0',
`keyword` varchar(32) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `keywords` VALUES (1, 'pascal');
INSERT INTO `keywords` VALUES (1, 'basic');

CREATE TABLE `lexicon` (
`id` int(11) NOT NULL auto_increment,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

INSERT INTO `lexicon` VALUES (1, 'Well known programming language.');

then I want result like:

|description|keywords|
|Well known programming language.|pascal, basic|

Please gimme example or some clue if its possible at all

Piotr

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация