January 5, 2012 at 10:50 pm
Hi guys,
I have a table object. It has multiple rows attached in tblRecords.jpg file.
Now, I m editing 2nd record and it has 17657,17676 tbls and it has status 6. And that row tbls present in row 3 and row 3 is a main record which status is 2.
So If I edit status 6 row then It needs to show row 3 tbls i.e. 17657,17658,17673,17676.
Any help on this would be greatly appreciated.
Thanks in advance.
January 6, 2012 at 7:51 am
You are going to have to provide a LOT more information before anybody can help. We need to have ddl (create table scripts), sample data (insert statements) and desired output based on your sample data. We need a clear definition of what you are trying to do. Read the article in the first link of my signature. It explains what to post and how to put it together.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
January 7, 2012 at 1:15 am
Well Noted.
Thank you!
January 7, 2012 at 2:18 am
If i understand you correctly you want to update the rows with status value equal to 6 with row with status value equal to 2. Then you may try
update t1 set t1.tbl = t2.tbl
from tbl t1,tbl t2
where t1.status = 6
and t2.status = 2
Next time pls post create and insert scripts
Regards,
Raj
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply