Search
 
SCRIPT & CODE EXAMPLE
 

SQL

stuff in sql server

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

SELECT  ID
       ,STUFF((SELECT ', ' + CAST(Value AS VARCHAR(10)) [text()]
         FROM @Table1 
         WHERE ID = t.ID
         FOR XML PATH(''), TYPE)
        .value('.','NVARCHAR(MAX)'),1,1,' ') List_Output
FROM @Table1 t
GROUP BY ID
Comment

stuff in sql server

STUFF(string, start, length, new_string)
SELECT STUFF('SQL Tutorial', 1, 5, 'HTML');
-- output
-- HTMLutorial
Comment

stuff in sql

STUFF Function: This function is used to
overwrite existing character or inserts
a string into another string. 

REPLACE function: This function is used 
to replace the existing characters
of all the occurrences.
Comment

PREVIOUS NEXT
Code Example
Sql :: sql decimal with 2 places 
Sql :: how to exit mysql terminal 
Sql :: sql selet 
Sql :: mysql_union 
Sql :: primary key 
Sql :: rename command in sql 
Sql :: limit rows after order by oracle 
Sql :: how to generate er diagram in mysql workbench 
Sql :: join multiple tables in sql same table 
Sql :: select from table and insert into table in sql 
Sql :: sql table contains 
Sql :: if mysql UPDATE 
Sql :: mysql 5 minutes ago 
Sql :: in subquery terminology, the first query in the sql statement is known as the _____ query. 
Sql :: sqlalchemy get sql 
Sql :: postgres type equivalent to timespan c# 
Sql :: cube oracle 
Sql :: contraint default SQL 
Sql :: java input type sql date 
Sql :: create backup 
Sql :: basic structure of sql expression having clause 
Sql :: sql server bool select 
Sql :: how to create a new db from dumb file mysql 
Sql :: update multiple columns in postgres 
Sql :: providername system.data. mysql 
Sql :: SQL RIGHT JOIN With AS Alias 
Sql :: get enginge db mysql 
Sql :: cara menampilkan tabel yang tidak mengandung kata di sql server 
Sql :: hoq to import database source 
Sql :: sql how to get courses that i have made prerequisites 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =