Yes, there's a simpler way to do it which is faster, too. It's on the articles I showed you and I'm guessing it can be at least 3 times faster in execution and won't need you to create additional objects. The articles also show how to make this dynamic.
SELECT MAX(CASE WHEN LocationName = 'Alston' THEN Activecases END) Alston_ActiveCases
,MAX(CASE WHEN LocationName = 'Keswick' THEN Activecases END) Keswick_ActiveCases
,MAX(CASE WHEN LocationName = 'Penrith' THEN Activecases END) Penrith_ActiveCases
,MAX(CASE WHEN LocationName = 'Alston' THEN LastSeen END) Alston_LastSeen
,MAX(CASE WHEN LocationName = 'Keswick' THEN LastSeen END) Keswick_LastSeen
,MAX(CASE WHEN LocationName = 'Penrith' THEN LastSeen END) Penrith_LastSeen
,MAX(CASE WHEN LocationName = 'Alston' THEN Refresh_date END) Alston_Refresh_date
,MAX(CASE WHEN LocationName = 'Keswick' THEN Refresh_date END) Keswick_Refresh_date
,MAX(CASE WHEN LocationName = 'Penrith' THEN Refresh_date END) Penrith_Refresh_date
FROM test