Skip to content
Advertisement

Tag: pivot

NULL fields using PIVOT

I request your collaboration because pivot on a table and separating the records by null, but still leave the fields at 0 with NVL Table product | value ———-+——- Shirts | 1200 Caps …

SQL Pivot String Data

I have a tables in SQL Server: Product Product Table: This is the output that I need: An ImageID can have maximum 3 ProductID It is not necessary that all ImageID will have 3 products [eg. ImageID=3] Answer Your were very close, you just needed to incorporate Row_Number() Example

Advertisement