Advertisement
radostina92

Untitled

Oct 10th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. --5ta
  2. SELECT [Description], FORMAT(OpenDate, 'dd-MM-yyyy') FROM Reports
  3. WHERE EmployeeId IS NULL
  4. ORDER BY OpenDate, [Description]
  5. --6ta
  6. SELECT r.[Description], c.[Name] FROM Reports r
  7. JOIN Categories c ON c.Id = r.CategoryId
  8. ORDER BY r.[Description], c.[Name]
  9.  
  10. -7ma
  11. SELECT TOP(5) c.[Name], COUNT(*) AS [ReportsNumber] FROM Reports r
  12. JOIN Categories c ON c.Id = r.CategoryId
  13. GROUP BY c.[Name]
  14. ORDER BY [ReportsNumber] DESC, c.[Name]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement