SQL SERVER - 2005 - Difference Between INTERSECT and INNER JOIN (blog.sqlauthority.com)

submitted by pinaldavepinaldave(9662) 3 years, 9 months ago

INTERSECT operator in SQL Server 2005 is used to retrieve the common records from both the left and the right query of the Intersect Operator. INTERSECT operator returns almost same results as INNER JOIN clause many times. When using INTERSECT operator the number and the order of the columns must be the same in all queries as well data type must be compatible. Let us see understand how INTERSECT and INNER JOIN are related.We will be using AdventureWorks database to demonstrate our example.

3 comments |category: |Views: 294

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dotnetterdotnetter(0) 3 years, 9 months ago 0

great going...

Reply

posted by rsivamrsivam(0) 3 years, 9 months ago 0

Which one I should use finally?

Reply

posted by pinaldavepinaldave(9662) 3 years, 9 months ago 0

It all depends on your query and table size. I suggest you should test the performance and pick one which gives the best.

Reply

information Login or create an account to comment on this story