Support the ongoing development of Laravel.io →
posted 6 years ago
Last updated 1 year ago.
0

You this sql query.

SELECT Id = 1, MarkId = 1, Mark = 15 INTO #Temp UNION SELECT Id = 1, MarkId = 2, Mark = 16 UNION SELECT Id = 1, MarkId = 3, Mark = 17 UNION SELECT Id = 2, MarkId = 1, Mark = 25 UNION SELECT Id = 2, MarkId = 2, Mark = 26 UNION SELECT Id = 2, MarkId = 3, Mark = 27

SELECT * FROM #Temp

SELECT Id, [1], [2], [3] FROM (SELECT Id, MarkId, Mark FROM #Temp) AS SourceTable PIVOT (Min(Mark) FOR MarkId IN ([1], [2], [3])) AS PivotTable

DROP TABLE #Temp

By:Xtreem Solution

Top laravel web developers

Dedicated PHP Developer

Last updated 6 years ago.
0

The real issue is in laravel view not in sql. Actually, I want to merge or rowspan a row for the same record in the html table. I want the result like this attach image.enter image description here

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.