Q:

mysql how to make a query like this

Here is some innodb table, am store products id, bm store description key words. 
CREATE TABLE IF NOT EXISTS `myt` (
  `am` varchar(15) NOT NULL,
  `bm` varchar(30) NOT NULL,
  KEY `am` (`am`),
  KEY `bm` (`bm`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `myt` (`am`, `bm`) VALUES
('1', 'hello'),
('1', 'world'),
('2', 'this'),
('2', 'world'),
('3', 'hello'),
('2', 'there');

How to get a products which has words 'hello world'?
Query that i tried:
(select * from myt a where bm='hello') union (select * from myt b where bm='world') where a.am=b.am

gave me an error:
 #1064 - You have an error in your SQL syntax;

If i store data like this, should index be worked? Thanks.
P.S. 
Is it matter if a innodb table without primary key?

A:

Try This ....
select * 
from 
    (
        select * 
        from myt 
        where bm='hello' 
        group by am
    ) t
join 
    (
        select * 
        from myt 
        where bm='world' 
        group by am
    ) t1 
    on t.am=t1.am

