Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

QUERY REWRITE - forum topic by ashikmh

$
0
0

HI ALL,
I AM FACING THE BELOW PROBLEM AT MY SITE.
 
select  TABLE1.*
from    work_db.TABLE11 XLA
        inner join
        work_db.TABLE2
   on  (   (    TABLE1.COLUMN1 = TABLE2.COLUMN1
          and   TABLE1.COLUMN2 = TABLE2.COLUMN2)
       or   TABLE1.COLUMN3 = TABLE2.COLUMN3);
THE ABOVE QUERY IS PRODUCING A BAD PRODUCT JOIN IN THE EXPLAIN PLAN. I KNOW THAT USING UNION I CAN RESLOVE THIS ISSUE.
CAN WE RE WRITE THIS SQL WITH OUT USING UNION ?
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>