I have an Access DB that we use to track tickets. Due to various programming changes associated with that ticket, there can be multiple incidents in each ticket. Each record also has a program_type field which is SVR or VB. Example:
123456 - SVR - some code 123456 - VB - some VBCD
I added a column to the database named VB_flag, which is incorrect with 0 That is, I want to change the number of VB codes for each ticket. Therefore, the result of this will be:
123456 - SVR - some code - 1 123456 - VB - some VBCID - 1
But, I can not understand To write this update query, exit my life before I tried:
UPDATE table SET VB_Flag = 1 WHERE program_type = 'VB'
But it has clearly left all the SVR code which has shared the ticket number with the VB code.
I'm getting help
This should work:
UPDATE table SET VB_Flag = 1 where TicketN IN (Select ticket from program_type = 'VB')
Comments
Post a Comment