Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Sql Server join multiple column values and separate with comma

DECLARE @Table1 TABLE(ID INT, Value INT);
INSERT INTO @Table1 VALUES (1,100),(1,200),(1,300),(1,400);


SELECT ID , STRING_AGG([Value], ', ') AS List_Output
FROM @Table1
GROUP BY ID;
Comment

PREVIOUS NEXT
Code Example
Sql :: copy sql table 
Sql :: table information in sql server 
Sql :: operator does not exist: integer = text 
Sql :: oracle list index on table 
Sql :: sql server alter table add column datetime default current_timestamp 
Sql :: oracle apex prevent initial load 
Sql :: How to select the nth row in a SQL database table? 
Sql :: postgresql get last day of month 
Sql :: mysql find non alphanumeric characters 
Sql :: delete all entries postgres 
Sql :: ddl view 
Sql :: get parameter value in mysql trigger 
Sql :: mssql cursor 
Sql :: how to install mysql server on centos 7 
Sql :: how to get table structure in sql server 
Sql :: add created and updatedAt fields in mysql 
Sql :: sqlserver create table from select 
Sql :: get unix time roblox 
Sql :: postgres list tables and row counts 
Sql :: sqlite check if row exists 
Sql :: mariadb number format 
Sql :: backup mysql data only 
Sql :: UPDATE if else mysql 
Sql :: pl sql asynchronous procedure calls 
Sql :: sql server cannot create database diagram 
Sql :: shell mysql connect 
Sql :: like sql 
Sql :: sql select between two dates 
Sql :: select amount weeks between two dates mysql 
Sql :: Copy Table from SQL to CSV 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =