|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
table 1
abc 241060 3332.29 table 2 abc def 241060 OH_Adm_InsPremOth table 3 def OH_Adm_InsPremOth 3332.29 result of inner join table 1 abc = table 2 abc and inner join table 2 def = table 3 def 241060 3332.29 OH_Adm_InsPremOth 3332.29 The above is fine but if I have table 1 abc 241060 3332.29 241070 5000.00 table 2 abc def 241060 OH_Adm_InsPremOth 241070 OH_Adm_InsPremOth table 3 def OH_Adm_InsPremOth 8332.29 result of inner join table 1 abc = table 2 abc and inner join table 2 def = table 3 def 241060 3332.29 OH_Adm_InsPremOth 8332.29 241060 3332.29 OH_Adm_InsPremOth 8332.29 241070 5000 OH_Adm_InsPremOth 8332.29 241070 5000 OH_Adm_InsPremOth 8332.29 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
If you add SELECT DISTINCT ... that would only give you 2 back, but
the join probably isn't correct. Can you send us some actual SQL. If you do your join right, you should only get 2 results back from the second scenario without the SELECT DISTINCT. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi, This is my SQL
SELECT q.account, q.entity, q.time_period, q.value1, ltrim(h.account), h.value1 , h.ent, h.icp, h.c1, h.c2, h.c3, h.c4, ma.reverse FROM q2 q INNER JOIN maps ma ON q.account = ma.srcacc INNER JOIN hfm h ON ltrim(ma.dstacc) = ltrim(h.account) where q.entity = '2111' and q.time_period = '03' Regards "Eric Isaacs" wrote: > If you add SELECT DISTINCT ... that would only give you 2 back, but > the join probably isn't correct. Can you send us some actual SQL. If > you do your join right, you should only get 2 results back from the > second scenario without the SELECT DISTINCT. > > |
|
![]() |
| Outils de la discussion | |
|
|