List:General Discussion« Previous MessageNext Message »
From:Alec.Cawley Date:May 30 2003 2:37pm
Subject:Re: Select Statment Question
View as plain text  
How about
SELECT * FROM book WHERE book_prg IN (1, 4, 6) ;

Dies that make any difference?





|---------+---------------------------->
|         |           "Anthony Ward"   |
|         |           <awards@stripped|
|         |           r>               |
|         |                            |
|         |           30/05/2003 15:29 |
|         |                            |
|---------+---------------------------->
 
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                       
                                                          |
  |       To:       <mysql@stripped>                                         
                                                                |
  |       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/mysql?unsub=1






Thread
Select Statment QuestionAnthony Ward30 May
Re: Select Statment QuestionAlec.Cawley30 May