Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
String agg
--Sql Server 2014 Express Edition --Batches are separated by 'go' --select @@version as 'sql server version' create table session_table ( sessionId varchar(100), log_timestamp varchar(100) ) insert into session_table values('1','27-10-2017'); insert into session_table values('1','28-10-2017'); insert into session_table values('2','27-10-2017'); insert into session_table values('2','28-10-2017'); insert into session_table values('3','27-10-2017'); insert into session_table values('4','29-10-2017'); insert into session_table values('4','27-10-2017'); insert into session_table values('3','29-10-2017'); insert into session_table values('5','28-10-2017'); insert into session_table values('5','10-10-2017'); insert into session_table values('8','23-10-2017'); insert into session_table values('8','29-10-2017'); select a.sessionId, stuff( ( select ',' , b.log_timestamp from session_table b where a.sessionId = b.sessionId order by b.log_timestamp for xml path('a'), type).value('.','nvarchar(max)'),1,1,'') as time from session_table a group by a.sessionId
run
|
edit
|
history
|
help
0
Basic Except
bc150200055
TRIGGERS
Import CSV File Into SQL Server Using Bulk Insert
yoo
Arun
Hierarchy table to exclude root
store2
index fragmentation and how to deal with it
Rextester.java