How about
SELECT * FROM book WHERE book_prg IN (1, 4, 6) ;

Dies that make any difference?





|---------+---------------------------->
|         |           "Anthony Ward"   |
|         |           <[EMAIL PROTECTED]|
|         |           r>               |
|         |                            |
|         |           30/05/2003 15:29 |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                                              |
  |       To:       <[EMAIL PROTECTED]>                                                
                                                          |
  |       cc:                                                                          
                                                              |
  |       Subject:  Select Statment Question                                           
                                                              |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|




Hi,

I have to search a big database.
Now there are many categories i.e computerlanguage = C++, Perl,Php,Visual
Basic, C, Javascript.
In my table
C++ =1
Perl = 2
PhP = 3
VB = 4
C = 5
Java = 6

and i have a select statment like this
SELECT * FROM lang WHERE language = 1 OR language = 2 OR  language = 4 OR
language =6
since this does use indexes!! because of the or statment is there a way i
can make it more efficient, because i have to join this statment with book
i.e
Select * FROM book  WHERE book_prg = 1 OR book_prg = 4 OR book_prg=6

Any help is appreciated!!



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]







-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to