I am new to SQL Server and this is my first post.
I am getting the message "incorrect syntax near '=' when using the Case Statement. Here is an example of my code:
Select * , CASE when a > b THEN b = a when c > d THEN d = c when e > f THEN f = e when g > h THEN h = g when i > j THEN j = i when k > l THEN l = k when m > n THEN n = m when o > p THEN p = o END as value INTO #temptable From #atemptable
Thanks in advance for your help!