views:

16

answers:

2

hi everyone

how to find the records which are present in the second from the first table in sql server 2005.

A: 

You should have a look at SQL SERVER – Introduction to JOINs – Basic of JOINs.

This is a very good article with graphical explanations of what the various joins are used for.

astander
A: 
SELECT
   *
FROM
   Table1 T1
WHERE
   EXISTS (SELECT * FROM 
          Table2 T2
      WHERE
          T2.CommonColumn = T1.CommonColumn)
gbn