Member_2_6478753
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.