Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query challenge 4: two groups, same item, different valu
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00097438
Message ID:
00097757
Views:
23
>>select * ;
>>from thetable A, thetable B;
>>where a.groupnum <> b.groupnum and;
>>a.itemnum = b.itemnum and;
>>a.quantity <> b.quantity

>Also, my problem wasn't quite as simple as I said. There are really more than two groupnums, so I made a query that selects WHERE groupnum = 1 OR groupnum = 2 and then ran your query off that cursor. Perhaps I could have merged them into one cursor, but this way seemed easiest.

Yup. You can just add the condition to the above query that
(a.groupnum = 1 or a.groupnum = 2)

Self joins are quite powerful. Glad I could help.
Previous
Reply
Map
View

Click here to load this message in the networking platform