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.
| Author |
Topic |
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2011-11-19 : 20:05:58
|
| I get a monthly data feed in excel with pcpid and memberid information.I'm supposed to get member information for all the members associated only with the pcpid in the spreadsheetHow do i write a query so that i associate a memberid only with the pcpid given in the spreadsheetThe problem iam having is when i write a query to bring the member information by providing pcpid in list is i get multiple records for a member as the member might earlier be associated with another memberidThanksJim |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-20 : 01:42:05
|
| sorry didnt understand one thing. if you've memberid in spreadsheet why cant you use it for looking up details of member directly. why should you use ppid to get related members and then their infrmation.Also if more than members are associated with same ppid, which one should you return? is there some other unique valued column on basis of which you determine that.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
johntech
Yak Posting Veteran
51 Posts |
Posted - 2011-11-21 : 04:56:34
|
| I'm not sure if i understand you ,But as i thought that you need to add 2 conditions to determine the specific row u need ,Or you can use a composite primary key so you need to write "where pcpid=@id and 'another condition'"Thanks |
 |
|
|
|
|
|