SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 select query Inner join vs left join
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cplusplus
Aged Yak Warrior

533 Posts

Posted - 02/17/2013 :  13:47:11  Show Profile  Reply with Quote
I am making an inner join in etl job , first table has 7000 rows second table has 12000 rows.

because of inner join i am getting the result output exact 7000 rows, which is first table match count.

How can i get 12000 rows as my result can i just do left join, will it produce 12000 rows as my final result?

This is based on an ETL job, this one element is part of a bigger job which takes almost 7 hrs.

Just would like to have the details then will make the necessary changes.


Thanks a lot for the helpful info.

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 02/17/2013 :  14:06:42  Show Profile  Reply with Quote
you need to do a left join with bigger table on left side of the join to get 12000 rows

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

cplusplus
Aged Yak Warrior

533 Posts

Posted - 02/17/2013 :  14:28:08  Show Profile  Reply with Quote
Thks Visakh, you are an amazing guy
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 02/17/2013 :  23:22:06  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000