D
Diego
Guest
is there a way to make what is equivalent of a minus operation from SQL in Progress? I have 2 selects and want the first minus the second. For example, originally in SQL something like this:
I'm trying to do it like this in Progress
When I try to do this, however, I receive an error message. Is there an easy way (or at least easier) to do this? Thanks.
Continue reading...
Code:
select id from item
minus
select id from item-uni
I'm trying to do it like this in Progress
Code:
DEF TEMP-TABLE tt-item NO-UNDO
FIELD item-id AS INT
FIELD desc AS CHAR
.
DEF TEMP-TABLE tt-item2 NO-UNDO
FIELD item-id AS INT
FIELD desc AS CHAR
.
FOR EACH item-uni
WHERE item-uni.desc = '101':
CREATE tt-item.
ASSIGN
tt-item.item-id = item-uni.item-id
tt-item.desc = item-uni.desc
.
END.
FOR EACH item:
CREATE tt-item2.
ASSIGN
tt-item2.item-id = item.item-id
tt-item2.desc = item.desc
.
END.
FOR EACH tt-item,
EACH tt-item2
WHERE tt-item.item-id = tt-item2.item-id:
DELETE tt-item.
END.
When I try to do this, however, I receive an error message. Is there an easy way (or at least easier) to do this? Thanks.
Continue reading...