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
 General SQL Server Forums
 New to SQL Server Programming
 Create a unique Record

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2013-08-27 : 05:57:42
Hi,

I have the following code which gives results as shown below;

SELECT dbo.tblPractice.PracticeCode, dbo.tblPractice.DateJoined, dbo.tblContacts.FirstName + ' ' + dbo.tblContacts.LastName AS FullName, dbo.tblContactType.ContactType
FROM dbo.tblPractice INNER JOIN
dbo.tblRegion ON dbo.tblPractice.RegionID = dbo.tblRegion.RegionId INNER JOIN
dbo.tblContacts ON dbo.tblPractice.PracticeCode = dbo.tblContacts.PracticeCode INNER JOIN
dbo.tblContactType ON dbo.tblContacts.ContactTypeID = dbo.tblContactType.ContactTypeID


Results:
Practicecode DateJoined FullName ContactType
A1 01/01/2001 John Smith Primary
A1 01/01/2001 Peter Tim Secondary

I want to update my query so that it has ONLY one record as below;

Practicecode DateJoined PriFullName SecFullName
A1 01/01/2001 John Smith Peter Tim

Thank you

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-08-27 : 06:22:36
Dupliate thread...
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=187733

@dr223,
Follow previous thread for continuation


--
Chandu
Go to Top of Page
   

- Advertisement -