Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Helo,
Can anyone tell me scenarios when to use Join and when to use Keep ?
tHanks
 simospa
		
			simospa
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 prma7799
		
			prma7799
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 prma7799
		
			prma7799
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 prma7799
		
			prma7799
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		See below more idea.
 buzzy996
		
			buzzy996
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 nikhilgarg
		
			nikhilgarg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
