SQL Server subquery syntax

SQL Server

 

Famous database from Microsoft. Skyvia requires the server to be available from Internet.

Using a subquery in SQL statement

Query Text

SELECT
    u.Name User_Name,
    (SELECT COUNT(*) FROM Packages p WHERE p.authorid = u.ID) Packages_Count
FROM 
    Users u
ORDER BY
    User_Name
  

Open Query