Q:

Remove row values and convert into single column value

I have a stored procedure returning a table that looks like this:
ID | Type | Price | Description
-------------------------------
7  | J    | 50.00 | Job
7  | F    | 20.00 | Freight
7  | P    | 30.00 | Postage
7  | H    |  5.00 | Handling

I would like it to return the table like this:
ID | Type | Price | Description | FreightPrice
-----------------------------------------
7  | J    | 50.00 | Job         | 20.00
7  | P    | 30.00 | Postage     | 20.00
7  | H    |  5.00 | Handling    | 20.00

Is there a way that I can use a query such as:
SELECT * FROM Temp WHERE Type = 'F'

but return the 'Freight' row as a column instead with just the 'Price' value?
From what I have seen it appears that I may need to use the PIVOT operator to achieve this but that seems overly complex. Is there a way that I could achieve this result using a CASE or IF expression?

A:

Based on the data you provided, there is one row having the description value: "Freight". Assuming this is the case, then try:
select ID,Type,Price,Description,
       FreightPrice = (select Price 
                       from mytable 
                       where Description = 'Freight')
from mytable
where Description <> 'Freight'

