Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Matching two sets of data

Author  Topic 

Humate
Posting Yak Master

101 Posts

Posted - 2008-03-12 : 11:44:14
Hi All,

I would like to match two sets of data. I have setup a view of data that contains a group of customers and their details. I want to view this data, but also find these customers in another table based on matching their surname and date of birth, then retreive the information stored on these customers from the second table.

Does anyone have any suggestions how i would go about doing this?

Thanks in advance
Humate

quote:
Originally posted by Michael Valentine Jones

It takes real skill to produce something good out of a giant mess.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-12 : 11:50:34
Yes.
See http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx to start with.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-12 : 12:32:28
I think this is what you want:-
SELECT * FROM YourView v
INNER JOIN OtherTable t
ON t.DateOfBirth=v.DateOfBirth
AND t.surname=v.surname

if it does nt give you results please post your table structure along with sample data.
Go to Top of Page
   

- Advertisement -