November 30, 2010 at 6:44 pm
I have two tables (PmtTrn & AdjTrn). Both of these table a column called Itrn. Basically, if the same records on AdjTran table exist as in PmtTrn table, I want it to be flagged as "Yes" on PmtTrn table.
How can I acheive this? Am I table to use Case Expression? If so, any hints or suggestions would be helpful.
November 30, 2010 at 9:28 pm
Please provide the DDL and some sample data with the expected results. This will help people to reply faster.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
November 30, 2010 at 9:57 pm
Hi
As u said, the column name "itrn" is same in both the tables. Please let us know the column name to be updated to "YES" on the existence of the same record on both these tables.
Regards
Priya
Regards
Priya
November 30, 2010 at 10:26 pm
you can update the column to 'YES' using the from clause and inner join. some thing like
update PmtTrn
set PmtTrn.column_yes = 'YES'
From PmtTrn
Inner Join AdjTrn
on AdjTrn.itrn = PmtTrn.itrn
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply