Search
 
SCRIPT & CODE EXAMPLE
 

SQL

use concat in group_concat

SELECT GROUP_CONCAT(
	CONCAT(
		'{ID:',	ID,
        ',ParentID:', ParentID,
        '}'          
	) SEPARATOR ","
) FROM table
Comment

group_concat in mysql

GROUP_CONCAT(eng_category_name SEPARATOR ',') as eng_category_name
Comment

use group_concat in concat

SELECT
    CONCAT(`Name`, ':', GROUP_CONCAT(`Value` SEPARATOR ',')) AS `Name`
FROM table
GROUP BY `Name`
Comment

group_concat mysql

 //returns the concatenated string from multiple rows into a single string
 SELECT emp_id, emp_fname, emp_lname, dept_id,     
GROUP_CONCAT(designation) as "designation" FROM employee group by emp_id;  
Comment

sql group_concat

GROUP_CONCAT() VS STRING_AGG() 

SELECT CustName, Address, GROUP_CONCAT(Address, ' || ') As CustAddress  FROM  Customers Group By CustName
#Group_Concat() may not work 2018 and upgraded version 
#SQL and MySQL same 

SELECT CustName, Address, STRING_AGG(Address, ' || ') As CustAddress  FROM  Customers Group By CustName
#String_Agg() may not work some SQL version 
#SQL and MySQL same 

#KindHeartedRamesh
Comment

group_concat sql server

STRING_AGG ( expression, separator ) [ <order_clause> ]

<order_clause> ::=   
    WITHIN GROUP ( ORDER BY <order_by_expression_list> [ ASC | DESC ] )
    SELECT STRING_AGG(Genre, ',') AS Result
FROM Genres;
Result:

Result                                      
--------------------------------------------
Rock,Jazz,Country,Pop,Blues,Hip Hop,Rap,Punk
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres extract day from date 
Sql :: How to check if the column exists in sql table 
Sql :: full sql mode 
Sql :: null sql 
Sql :: create or replace function 
Sql :: date format mysql 
Sql :: mysql add column to table 
Sql :: postgresql Create a new role with a username and password 
Sql :: creating postgresSQL database using the the shell 
Sql :: mariadb json_extract 
Sql :: change data type postgresql 
Sql :: version and edition of SQL Server Database Engine 
Sql :: mysql if condition 
Sql :: import sql in postgresql 
Sql :: list all tables in postgres 
Sql :: postgres update multiple columns 
Sql :: mysql get last 2 month data 
Sql :: postgres user permissions 
Sql :: set value to null sql 
Sql :: mysql count by month 
Sql :: mysql datetime with timezone offset 
Sql :: insert into select mysql 
Sql :: create table with index mysql 
Sql :: mysql url data type 
Sql :: replace text in sql 
Sql :: make date with time sql 
Sql :: how to run a function in sql 
Sql :: function in postgresql 
Sql :: select users with same username 
Sql :: sql server change column data type 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =