|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Get my greedy down
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2003
Location: daejeon, South Korea
Posts: 1,753
|
join and inner join
Code:
myTable24 (m) id (1) Tom (2) Kojack (3) Jimmy (4) Mary myTable25 (s) top say tm (1) America I like America 1 (2) France I am from France 4 (3) 1 I visited New York yesterday 3 (4) China China is good 3 (5) 1 Chicago is a city 2 (6) 2 Paris is beutiful 1 Code:
code1 select s, top, say, tm,id from myTable25 join myTable24 on tm=m where id like '%#variables.w#%' code2 select s, top, say, tm,id from myTable25 inner join myTable24 on tm=m where id like '%#variables.w#%' What is the different between join and inner join or which is correct? |
|
|
|
|
|
#2 | |
|
SQL Consultant
![]() ![]() ![]() Join Date: Jul 2002
Location: Toronto, Canada
Posts: 31,026
|
Quote:
in recent versions of mysql, INNER is an optional keyword, but in earlier versions, if you didn't say INNER, you ended up getting a CROSS JOIN this is why i always recommend using the optional keywords anyway -- it adds to clarity, and avoids problems so, always say INNER JOIN instead of JOIN, and always say LEFT OUTER JOIN instead of LEFT JOIN |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 16:26.











Hybrid Mode
