Parts Replacement

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla

Q&A for Joomla! administrators, users, developers and designers

CREATE table #tblReplacementParts
    ([Id] int, [Value] varchar(100), [ColumnName] varchar(2000))
;
    
INSERT INTO #tblReplacementParts
    ([Id], [Value], [ColumnName])
VALUES
    (1, '1000101', 'ItemCode'),
    (2, 'Test1111', 'Description'),
    (3, '1', 'Quantity')
;


select ItemCode, Description, Quantity
from
(
  select value, columnname
  from #tblReplacementParts
) d
pivot
(
  max(value)
  for columnname in (ItemCode, Description, Quantity)
) piv;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results