Hi dolly,
Please refer below query for your reference.
Database
For this example I have used of Northwind database that you can download using the link given below.
Download Northwind Database
SQL
SELECT
Price,
O.CustomerID,
C.ContactName,
C.Country
FROM (
SELECT TOP 10
SUM(Freight) AS Price,
CustomerID
FROM Orders
WHERE CustomerID IS NOT NULL
GROUP BY CustomerID
) O
INNER JOIN Customers C ON C.CustomerID = O.CustomerID