elena1234

One to many from one table ( T-SQL )

Jan 31st, 2022 (edited)
3,906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.23 KB | None | 0 0
  1.  SELECT [F2].[Id], [F2].[Name], CONCAT([F2].[Size], 'KB') AS [Size]
  2.     FROM Files AS [F]
  3.     RIGHT JOIN Files AS [F2]
  4.     ON [F].ParentId = [F2].Id
  5.     WHERE [F].[Id] IS NULL
  6.     ORDER BY [F2].[Id] ASC, [F2].[Name] ASC, [F2].[Size] DESC
  7.  
Add Comment
Please, Sign In to add comment