Skip to content
Advertisement

Iterate rows base on its entries column value

I need help on SQL SELECT QUERY.

This is my TABLE.

I want to select get them like this

If you can notice, Raffy Tulfo has 2 rows because it has 2 entries.

`

Advertisement

Answer

We can use cte to achieve this requirement if your mysql is version 8.0 up. but if its below, 1 way to do this is using dummy values using union.

see dbfiddle

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement