|
Posted by Gary L. Burnore on 02/02/06 00:19
On Wed, 01 Feb 2006 10:08:40 +0200, G0ng <hkosmidi@softnet.tuc.gr>
wrote:
>I have the following tables:
>
>students
>id, name,....
>
>lessons
>id,description,....
>
>studentslessons
>id,studentid,lessonid,grade
>
>I want to list the lessons of student with name="John" for example.
>
>The one way to do it is :
>select id from students where name="John" and grab the id. then select *
>from studentslessons where studentid=id;
>
>the other is
>select * from students,studentslessons where students.name="john" AND
>students.id=studentslessons.studentid
>
The second would be more efficient.
>
>Which is more efficient when using php4 and mysql 4.1? I'm using a
>rather old computer Pentium 800MHz.
THe cpu and versions are irrelevent.
>
>thanks
Try comp.databases.mysql next time (added to subject line for your
convenience)
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================
[Back to original message]
|