Link to home
Start Free TrialLog in
Avatar of Member_2_6478753
Member_2_6478753Flag for United States of America

asked on

tsql how to update column in all records of a table ..

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT top 2 p.ProgramID,a.ProgramIDM
  FROM [radiomix].[dbo].[chat] a
 inner JOIN [radiomix].[dbo].[MixFmProgram] p ON (a.DAY = p.ProgramWeekDay)
   WHERE 
  CONVERT(varchar,[datetimein], 114) >= convert(varchar, CONVERT(datetime,p.ProgramStart), 114)
and CONVERT(varchar,[datetimein], 114) < convert(varchar, CONVERT(datetime,p.ProgramEnd), 114 )
 order by a.id desc

Open in new window


this is the querry
i want to update all p,ProgramIDM to the a.ProgramID


iin this example i have selected only 2 record order by a.id desc
i want to update the value of programidm in table chat by the correct one ??
what should be the query ??
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial