Here is a graphical representation of what I need:ticket_____________________event___________________event104-520______________NULL____________________NULL04-520______________NULL____________________NULL04-520______________BRF1104000130___________NULL04-520______________NULL____________________NULLticket_______________event___________________event104-520________NULL____________________BRF110400013004-520________NULL____________________BRF110400013004-520________BRF1104000130___________BRF110400013004-520________NULL____________________BRF1104000130Note how the second table now has an event number for each ticket number, whereas before there was only one instance of an event number for the entire series of tickets.I would appreciate the code (I'm thinking its an Update with a join or a case statement, I just cant seem to get it right, nor am I finding this anywhere on the web), but if you know of a link elsewhere on these forums that solves this problem, please let me know. ~ D Khtan, Thanks for the reply, but this doesnt seem to work.When trying to update multiple rows though I believe I'm getting stuck on having to have 60,000 unique key identifiers.
The CTE result set is derived from a simple query and is referenced by UPDATE statement.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.Common table expressions can also be used with the SELECT, INSERT, DELETE, and CREATE VIEW statements. For information about table hints, see , 'expression' should be prefixed with the capital letter 'N'.For more information, see Specifies one or more table hints that are allowed for a target table. If 'N' is not specified, SQL Server converts the string to the code page that corresponds to the default collation of the database or column.