i was wondering how would i make a sql code that makes one column merge into one line
please see attached photo of an example table of before and after of what i need
can this be done
any help will be appreciated
i was wondering how would i make a sql code that makes one column merge into one line
please see attached photo of an example table of before and after of what i need
can this be done
any help will be appreciated
Use GROUP_CONCAT()
in mySQL or mariaDB, STRING_AGG()
in SQL server, Oracle or Postgres.
Here is an example in mySQL:
create table examples( id int, example varchar(10)); insert into examples values (1,'Example 1'), (2,'Example 2'), (3,'Example 3'), (4,'Example 4');
select group_concat(example) Examples from examples;
| Examples | | :-------------------------------------- | | Example 1,Example 2,Example 3,Example 4 |
db<>fiddle here