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
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community