Every time I use this syntax, I get the idea that there is probably a better way. Hire Period FROM #Act Empl INNER JOIN (SELECT Employee ID, CASE WHEN MONTH(e. Employee ID IN (SELECT Employee ID FROM #Emp List) ) AE ON AE. If I were to write the same update query, I would probably opt to restate my IN part as a join and also move the sub-select out like this: update a set Hire Date FY = case when month(e. How To Return Only 1 Entry Per Row When A Column Can Contain Multiples Point of update when using case in an Update statement How to write html code in sql server 2005?
All I want to do is update two columns in a table from another table. SQL-2000 is preferable, but I'd like to see other solutions too.
TOT_COST 2.000 from DBRMAST T1 inner join DBRMAST t2 on t2. Would you like to answer one of these unanswered questions instead?
By commenting, you are accepting the DISQUS terms of service.
This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.
When you sign in to comment, IBM will provide your email, first name and last name to DISQUS.
UPDATE summary_data SET current_category = (SELECT category_id FROM products WHERE products.product_id = summary_data.product_id) WHERE EXISTS (SELECT category_id FROM products WHERE products.product_id = summary_data.product_id); If you want to test your skills using the SQL UPDATE statement, try some of our practice exercises.
These exercises allow you to try out your skills with the UPDATE statement.