---
title: "Discussion on \"SQL aggregation function: STRING_AGG\" | Hashnode"
description: "Discussion on \"SQL aggregation function: STRING_AGG\". STRING_AGG is an aggregate function that takes all expressions from rows and concatenates them into a single string.\nFOR XML PATH is the previous version of the STRING_AGG function :\nselect a.NameSurname\n-- previous version\n, stuff((select ',' + x.Ph..."
url: "https://hashnode.com/posts/sql-aggregation-function-stringagg/6467c043745d5d5f008065cd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SQL aggregation function: STRING\_AGG](https://karatas.dev/sql-aggregation-function-stringagg?utm_source=hashnode&utm_medium=feed)

STRING\_AGG is an aggregate function that takes all expressions from rows and concatenates them into a single string. FOR XML PATH is the previous version of the STRING\_AGG function : select a.NameSurname -- previous version , stuff((select ',' + x.Ph...

May 19, 2023 · 1 min read · karatas.dev  
Read the article

-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Ferhat Karataş](https://hashnode.com/@karatas)

@karatas · Turkey

  
[View profile](https://hashnode.com/@karatas)

Software Developer

Performance freak

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
