Hello, my name is Takanobu Kawabe.
I have some questions about left join SQL statement.
I want to join some tables, and using left join statement .
the system is the following. I use two machines.
I created the same databases and tables on both machines.
OS : Debian Linux the newest stable 3.1
Server : Apache 2.0
MySQL : 5.0.20
PHP : 5.1.4
OS : WindowsXP
Server : Apache2.0
MySQL : 5.0.19
PHP : 5.1.2
And I considered the following SQL statement to select some columns from
some tables using left join.
----------------------------------------------------------------------------
SELECT
`MST`.`no`,
`MST`.`denhyono`,
`GUS`.`TANI` AS `GUS`,
`SUIDO`.`TANI` AS `SUIDO`,
`DENKI`.`TANI` AS `DENKI`,
`SYOKUIN1`.`SYOKUINNAME` AS `SYOKUIN1`,
`SYOKUIN2`.`SYOKUINNAME` AS `SYOKUIN2`,
`TANTOSYA`.`TANTOSYANAME` AS `TANTOSYA`
FROM
`MST`
Left Join `TANIMST` AS `GUS` ON `MST`.`GUSno` = `GUS`.`no`
Left Join `TANIMST` AS `SUIDO` ON `MST`.`SUIDOno` = `SUIDO`.`no`
Left Join `TANIMST` AS `DENKI` ON `MST`.`DENKIno` = `DENKI`.`no`
Left Join `SYOKUINMST` AS `SYOKUIN1` ON `MST`.`SYOKUINno1` = `SYOKUIN1`.`no`
Left Join `SYOKUINMST` AS `SYOKUIN2` ON `MST`.`SYOKUINno2` = `SYOKUIN2`.`no`
Left Join `SYOKUINMST` AS `TANTOSYA` ON `MST`.`TANTOSYAno` =
`TANTOSYA`.`no`;
---------------------------------------------------------------------------------
I tried this statement without error.
But Ihave some questions.
1.How many left join keywords can I use in one SQL statement if
there
are 5000 datas in one table?
2. when some customers use this query, can they read this query
exactly?
3. Will the above query speed become slowly if there are 5000
datas in one table?
Will the processing efficiency improve if I use multiple SQL
statement?
4.Is there any other effective SQL statement I can get better
processing efficiency?