TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sai Reddy
NA
214
31.6k
Stuff with XML PATH
May 7 2018 6:02 AM
id Email
1
[email protected]
1
[email protected]
2
[email protected]
3
[email protected]
3
[email protected]
output:
id email
1
[email protected]
,
[email protected]
2
[email protected]
3
[email protected]
,
[email protected]
I found the following query some where can you explain it?
SELECT id, Email =
STUFF((SELECT ', ' + Email
FROM comma b
WHERE b.id = a.id
FOR XML PATH('')), 1, 1, '')
FROM comma a
GROUP BY id
Reply
Answers (
1
)
SQL query for stock calculation
On delete set null on update set null