I have to come up with a convoluted SQL statement.

Here are the tables:

cfpurchases(purchaseid, storeid, sectionid, itemid, cost)
stores(storeid, sale)
sections(sectionid, olditemid, newitemid)
purchaseindex(account, purchaseid)

This is the output I need:
account, purchaseid, cost(if old), cost(if new)

I'm having trouble with the cost portions of the output.
I have to come up with a way to check the itemid vs. the olditemid. If they match, then the cost(old) column will hold a value and the cost(new) column will not (= NULL). And vice-versa.

Totally convoluted, I know. But I'm stuck with this problem.

Regards,
MizPippz