Forum Discussion
SezMe
Jun 23, 2024Copper Contributor
How to write SQL getting data from multiple rows
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[People]') AND type in (N'U'))
DROP TABLE [People]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [People](
...
- Jun 28, 2024I Think You could use this Query
SELECT STRING_AGG(Name,' And ') Names, Married Date FROM People GROUP BY Married
Regards
Arshad