![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can someone educate me as to the difference between specifying a condition on a join and a condition in a where clause. |
|
FROM extract a LEFT OUTER JOIN allocation b ON a.e_reg_ = b.reg_no_ AND b.period_ = 3 WHERE a.period_ = 3 |
|
FROM extract a LEFT OUTER JOIN allocation b ON a.e_reg_ = b.reg_no_ WHERE a.period_ = 3 AND b.period_ = 3 |
#3
| |||
| |||
|
|
I have an 'extract' table which has 1853 rows when I ask for all rows where period_ = 3. The allocation table for info has 210 rows. I have two scripts below. The first script where I specify a period on a join, brings back 1853 lines and works. The second script where I specify the period in the where clause only brings back 1844 rows. I have located the missing 9 rows and they don't look any different to the other 1844 rows. Can someone educate me as to the difference between specifying a condition on a join and a condition in a where clause. |
#4
| |||
| |||
|
|
Jane T wrote: Basically, the query is processed in this order: * FROM/JOIN * SELECT * WHERE * GROUP BY * HAVING * ORDER BY |

#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |