I'm new to the PIVOT function and so far I could not run any query successfully while pivoting a table. 

Here's the data source:

```none
region         countries
Africa         180
Antarctica     3
Asia           99
Europe         154
Middle East    54
North America  123
Oceania        87
South America  48

```

I need each region to become a column - only one row with the count of countries in the region.

Compatibility level: SQL Server 2019 (150)

I tried every suggestion I could find online but still can't understand what I am doing wrong.

```
SELECT [Africa], [Asia], [Middle East], [North America], 
       [Oceania], [South America], [Antarctica]
FROM (
  SELECT region, count(name) as countries
  FROM dbo.country
  Group by region
) AS pDataSource
PIVOT
(
 countries
    FOR region IN ([Africa], [Asia], [Middle East], [North America], 
    [Oceania], [South America], [Antarctica])
) AS pPivotTable

```

> 
> Msg 156, Level 15, State 1, Line 10  
> 
>  Incorrect syntax near the keyword 'FOR'.
> 
> 
>