Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Helo,
Can anyone tell me scenarios when to use Join and when to use Keep ?
tHanks
Hey,
Thanks but i have already gone thru these links. But i need to know when to use Joins na dwhen to use Keep
Thanks
Hey,
Thanks but i have already gone thru these links. But i need to know when to use Joins na dwhen to use Keep
Thanks
Hi Nikhil,
When using Join after joins (Left, Right, Inner, Outer) you get single table but after Keep join Join is perform but you get second table also.
Thanks
See below more idea.
u can use joins, u want to put ur 2 tables INPUT data into ONE OUT PUT TABLE after joins used.
u can use keep, u want to put ur 2 tables INPUT data into TWO OUT PUT TABLES after joins(KEEP) used.
Hi Nikhil,
Generally Join is used to join two tables into a single table. But sometimes it is not possible to join tables with many to many mapping.
Lets take and example:
Table1:
ID, Status, Date
1, Invoice Raised, 1/1/2015
1, Invoice Approved, 1/2/2015
DetailTable:
ID, Amount
1, 100
1, 200
1, 300
2, 200
When you use join for the above tables it creates 6 records (2 * 3) because of many to many join. Also we need to exclude ID 2 from DetailTable. If we use Sum(Amount) you will get 1200, it is incorrect. So by using Left Keep we can fix this.
Hope this helps you.
Regards,
Jagan.
Hey thanks it helps but i didn't understand dat u said total 1200 is
incorrect but for id 1 total sld be 1200 as there are 2 different status to
id 1. Can u plz explain a bit more.