Hi Eric,
I have two tables TABLE_A, TABLE_B. I have created zombodb indices on both tables independently.
TABLE_A: custid,order_no
TABLE_B: custid,Lead_id
Now I need to join both the tables by using the 'custid' to improve the performance.
Regular SQL Query:
select A.custid, #Orders, #Leads from
(select custid,count(distinct Order_order_no) as #Orders from TABLE_A group by custid) A
left join (select custid,count(distinct Lead_id) as #Leads from TABLE_B group by custid)
On A.custid=B.custid
Can you please provide how the equivalent ZDB query will be like?
PS:
I did look at your answer to one of the threads, wherein you suggested OPTION at the time of creating linked index.
Probably that is not an acceptable solution to us because we can not decide what tables are to be linked at the time of index creation. We would prefer to have them
isolated and depending on our query requirement, we will join like the way we typically do with SQL. i.e., we would prefer to decouple the indices from the query use-case.
Thanks,
Samanth