Try

SELECT * FROM books_info WHERE MATCH(books_name) AGAINST ('Mysql') OR
MATCH(books_authors) AGAINST ('abc xyz') OR books_isbn LIKE "%8922b238h
%"

That should bring back any books with either 'Mysql' in the
'books_name', 'abc xyz' in the 'books_authors' or where the 'books_isbn'
matches the specified pattern.

Regards
John


John Daisley
Email: [EMAIL PROTECTED]

MySQL Certified Database Administrator (CMDBA)
MySQL Certified Developer (CMDEV)
MySQL Certified Associate (CMA)
Comptia A+ Certified Professional IT Technician














> Hi
> 
> Is it possible to have multiple MATCH and WHERE conditions in a single SELECT 
> query?
> 
> e.g.
> SELECT * FROM books_info MATCH(books_name) AGAINST ('Mysql') OR 
> MATCH(books_authors) AGAINST ('abc xyz') OR WHERE books_isbn LIKE 
> "%8922b238h%"
> 
> The table structure is as below
> --------------------------
> CREATE TABLE IF NOT EXISTS `books_info` (
>   `books_id` int(11) NOT NULL auto_increment,
>   `books_name` varchar(200) NOT NULL,
>   `books_authors` varchar(120) default NULL,
>   `books_isbn` varchar(20) default NULL,
>   `books_price` decimal(8,2) default NULL,
>   `books_publisher_id` varchar(50) default NULL,
>   `book_dateadded` datetime NOT NULL,
>   PRIMARY KEY  (`books_id`),
>   UNIQUE KEY `books_name` (`books_name`),
>   FULLTEXT KEY `books_name_2` (`books_name`,`books_authors`),
>   FULLTEXT KEY `books_authors` (`books_authors`),
>   FULLTEXT KEY `books_name_3` (`books_name`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=642 ;
> --------------------------
> 
> I am running Mysql 5.0.67.
> 
> Am I missing something?
> 
> Thanks
> Yunus
> 
> 
> 
> 
> ______________________________________________        
> This email has been scanned by Netintelligence        
> http://www.netintelligence.com/email

Reply via email to