SQL Server update query?
-
I have a table X with columns A and B and C with 3 rows of values as 8, 2009, 21 and 9,2009,21 and 10,2009,21 i have another table Y with columns E and F And G and H With 5 Rows of values as 8,2009,21,0 and 9,2009,21,0 and 10,2009,21,0 and 6,2009,23,0 and 7,2009,23,0 now i want a query which will update Table Y as Y.H = 101 where X.A = Y.E and X.B=Y.F and X.C=Y.G i want all three occurrences of the Y table to be updated.. any help is greatly appreciated.
-
Answer:
Try this -------- Table Y set Y.H = 101 from Y join X on X.A = Y.E and X.B=Y.F and X.C=Y.G --------
Netsailer 76 at Yahoo! Answers Visit the source
Other answers
The help my friend is to do your own homework. Figure it out if you want to become someone someday. If you think you do not like that subject then no one is forcing you to take it. But do your job yourself. By the way, your reply is almost there to the answer. Just fill it up with proper SQL.
Computer Kid
Related Q & A:
- How to control the excessive use of ram by SQL Server?Best solution by Database Administrators
- Can I create a second filestream container on an existing SQL Server 2008 database without going offline?Best solution by Database Administrators
- How to connect Sql Server Database from android app?Best solution by Stack Overflow
- How to upgrade sql server express 2005 to 2008R2?Best solution by Server Fault
- Does it ever make sense to use RAM Disk to force RAM allocation for tempdb with SQL Server 2008?Best solution by Database Administrators
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.