How to Combine Text from Many Rows into One Row in SQL

preview_player
Показать описание

If you have multiple rows of data, and want to combine them onto a single row with the values separated by commas (or another character), you can do this easily with SQL.

I'll show you how to do this in SQL for several different database vendors.

⏱ TIMESTAMPS:
00:00 - Oracle
02:05 - SQL Server
02:40 - MySQL
03:30 - Postgres
Рекомендации по теме
Комментарии
Автор

Thank you for the valuable lessons bruh. I usually use the GROUP_ CONCAT together with DISTINCT key word in MySQL to avoid the Cartesian product effect (multiplication of rows) when joining two junction tables, am usually careful in considering the relationships between the data in these tables, however sometimes it gives me hard time displaying this on a php view table especially when the rows from the two junction tables aren’t of the same count/legth(i.e one junction table has more rows than the second junction table)

abdiag
Автор

Hello Sir that videos you make are very well explaind I usually watch most of your videos.
Recently I came across a new SQL fucntion called MATCH and AGAINST which seems similar to LIKE clause can you please make a video on this.
Thanks In advance.

jatinsaini
Автор

First of all, thank you so much for all the time and effort you are putting in these videos. I cant stress enough how much they help!
I have a question about the topic of this video that has been bugging me for a while.
Is there a function or an operator that does the exact opposite of group_concat?
Say i have a column of series genres. Many of them, fall into more than one category. So the column has a list of the genres separated by a comma.
How can i separate the column into rows in mysql?
Is there any function easy way to do that of i have a lot of different scenarios that cant be addressed individually.
Thank you again!

RaananKikin
join shbcf.ru