Combine two large tables into one external Oracle SQL join by combining across the COBILL or COBILLSERVICE .

 select count (bs.COBILLSERVICE), count (distinct b.cobill), count (distinct b.cocontract) from bill b left OUTER JOIN BILLSERVICE bs on b.COBILL = bs.COBILL where bs.EXTERNALNUMBER >= 245491119 and bs.EXTERNALNUMBER <= 246278122 and b.COSOURCE = 2 
 select count (bs.COBILLSERVICE), count (distinct b.cobill), count (distinct b.cocontract) from bill b left OUTER JOIN BILLSERVICE bs on b.COBILL = bs.COBILL where b.createdate > to_timestamp ('04.09.17 19:51:10,910000000', 'DD.MM.YY HH24:Mi:SS,FF') and b.createdate < to_timestamp ('04.09.17 22:40:37,336000000', 'DD.MM.YY HH24:Mi:SS,FF') and b.cosource = 2 
  • According to them, different results are obtained. I want to know how to make a check that the fields are not duplicated in CREATEDATE. -
  • In the first query, because of the presence of selection conditions on the right table in WHERE, you get INNER JOIN - replace. Ps. What the author needs, I did not understand ... - Akina
  • There is a suspicion that the author simply needs the b.createdate . - Deft

0