Subject | Re: SQL query |
---|---|
Author | ibfa2000 |
Post date | 2002-04-26T08:47:55Z |
The tables are not readable in HTML, so let's give it again:
SET : (SET_ID, NAME)
ITEM : (ITEM_ID, NAME)
SET_ITEM : (SET_ID, ITEM_ID, QUANTITY)
SET : (SET_ID, NAME)
ITEM : (ITEM_ID, NAME)
SET_ITEM : (SET_ID, ITEM_ID, QUANTITY)
--- In ib-support@y..., "ibfa2000" <fabrice.aeschbacher@k...> wrote:
> Hi,
>
> Let be the following tables:
>
> SET SET_ITEM ITEM
> === ======== ====
> SET_ID SET_ID ITEM_ID
> NAME ITEM_ID NAME
> QUANTITY
>
> For a given SET_ID (let's call it S), I would like to create 2
> queries:
>
> - a query that returns all sets (i.e. all SET_ID) that have the
same
> content as S (i.e., that have exactly the same detail records in
> SET_ITEM)
>
> - a query that returns all super-sets of S (i.e., all sets
containing
> the same detail records in SET_ITEM, or more)
>
> Could anyone give me some hint to help me write these queries?
>
> Thanks,
> Fabrice