Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Soderpat
Starting Member
1 Post |
Posted - 2010-10-28 : 07:31:38
|
| Hi,The thing is to left join two sub-questions asSELECT * FROM (Select a, b, c from INNER JOIN c,d on and INNER JOIN where group by... and so on... )secThen,LEFT JOIN SELECT e,f on and INNER JOIN where group by... and so on... ) sec_t_1ON(sec.holkey_ref = sec_t_1.holkey_ref and sec.sec_ref = sec_t_1.sec_ref)WHERE sec_t_1.perf_to_date = TO_DATE ('&t0', 'yyyy-mm-dd') andsec.perf_to_date = TO_DATE ('&t1', 'yyyy-mm-dd')I know that the result should contain 37 rows but when executing this code the result contais 36 rows. However, the right result appears when I use perf_to_date = TO_DATE ('&t0', 'yyyy-mm-dd') as a condition in the subquestion sec_t_1 instead of having it in the main question as above. Shouldn't the two ways of doing it give exactly the same result? Thanks! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-02 : 03:57:09
|
| Also this is SQL Server forum. Post your oracle questions at www.orafaq.comMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|