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 |
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-06-26 : 04:19:33
|
| hi i am having tables likeEMRPatientProblemsEMRUncodedProblemsEMRLocationMasterEMRpatientsMasterEMRDiagnosisCodesLkupboth EMRPatientProblems and EMRUncodedProblems are having three common columns in it like PROBLEM_DESC,PROBLEM_CODE,STATUSif the values are same for both tables then is_coded one column inEMRPatientProblems tahtshould be updated to 1 as of now it is 0 for all rows .how can i achieve this?and emruncodedproblems is having group_is column where emrpatientproblems is not having and emrlocationmaster is having group_is colukm where that values shold be taken into consideration.only based on the group specific i have to update the is_coded column values to 1.please help me out in this? |
|
|
saran_d28
Starting Member
36 Posts |
Posted - 2009-06-26 : 05:57:00
|
| Hi,Update T1 set is_coded = 1From EMRPatientProblems T1join EMRUncodedProblems T2on T1.PROBLEM_DESC = T2.PROBLEM_DESCand T1.PROBLEM_code = T2.PROBLEM_codeand T1.status = t2.status--Sharan |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-06-26 : 07:08:25
|
| can you give me it through select query statement as i have to update it through third table emrlocationmaster as group_id column is there based on that i have to give it and emrpatientsmaster table where location_id is on more column out there |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-26 : 14:01:05
|
| can you post data in required format belowhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
|
|
|