|
-
Jul 25th, 2008, 10:48 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Impossible SQL statement?
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|