For simplicity, assume I have a table about pears and their descriptions. Some pears have multiple descriptions, each having their own record. Like this:PEARID - DESCRIPTION Pear01 - bruisedPear01 - greenPear02 - greenPear03 - funny lookingI need to find only the bruised pears and update all records for those so each record identifies it as bruised. From above, Pear01 - green would become Pear01 - bruised. There would then be two records in the database that said Pear01 - bruised.Also assume I want to leave the original descriptions alone and put my update into another column called NewDescription like below.PEARID - DESCRIPTION - NEWDESCRIPTION Pear01 - bruised - bruisedPear01 - green - bruisedPear02 - green - greenPear03 - funny looking - funny lookingCurrently I can identify the records I want using the following derived table, but I'd like to reduce steps and make this derrived table update on the fly:select Pears_table.PearID, BRUISEDPEARS.COUNTOFBRUISEDfrom Pears_table left join (select PearID, count(*) as COUNTOFBRUISEDfrom Pears_tablewhere description like ‘bruised'group by PearID) as HFCon Pears_table.PearID = BRUISEDPEARS.PearIDgroup by Pears_table.PearID, BRUISEDPEARS.COUNTOFBRUISEDhaving COUNTOFBRUISED > 0order by Pears_table.PearID
Thanks in advance