If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySql statement help [urgently]

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-04, 03:52
yorke1912 yorke1912 is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
MySql statement help [urgently]

Hi i need help here...
My sql statement is
$query = "SELECT * FROM ei_module m, ei_student s, ei_result r WHERE r.admin_no LIKE '". $adminno ."' AND r.exam_grade = 'A' AND r.module_code = m.module_code AND s.admin_no = r.admin_no";

what i want to get is

to display results with both Grade A or Grade B.
but i could only get : Grade A but not Grade B
Grade B but not Grade A
what must i do to my mysql statement in order to get the desire result.
Thanks for any kind soul who could help me with it.
Reply With Quote
  #2 (permalink)  
Old 10-28-04, 06:29
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
SELECT * FROM ei_module m, ei_student s, ei_result r WHERE r.admin_no LIKE '". $adminno ."' AND r.exam_grade in ('A','B') AND r.module_code = m.module_code AND s.admin_no = r.admin_no
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-03-04, 22:44
FastCougar FastCougar is offline
Registered User
 
Join Date: Feb 2004
Posts: 42
Using * in a select statement takes longer to run due to more disk I/O than specifying the fields that you want. If you make extensive use of the * instead of specifying the fields in a query, you will notice a performance increase by specifying only the fields that you want to retrieve.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On