How can I add a value of records records concidents

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
vindalencio
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 140
Joined: Thu, 16 Feb 2006 9:42 am
Location: Curitiba
Vanderlei Indalencio

Dear friends I have a debt and I can not solve it, I ask for help for the SRS.

I have a parent table, which contains cod_prod, seq_prod, value_prod. (COD, you can repeat SEQ can not)
I have another table table that contains the creditors of these products: cod_od, seq_prod, credl_product. (I can have n lenders for each product, lenders may be up to each product or different.)
My difficulty is:
I have to show in a report the values ??of each product with the sequential conditions :
If protonders have no creditors and have the same code, the value of them are added if the products have exactly the same creditors and the same code, are also added
And house this does not occur, show the distinct value of each product.

Please help me: Roll:
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

Face Use the "Split to Conquer" technique!
For example, it resolves this first:
If protudos do not have creditors and have the same cod, the value of them are added
0]]
Then this:
If the products have exactly the same lenders and the same code, they are also
and finally:
and house this does not occur, show the distinct value of each product.
Solving these parts You can use the features that a database managed has: Views, procedures, and functions, to join parts.

Gilberto
vindalencio
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 140
Joined: Thu, 16 Feb 2006 9:42 am
Location: Curitiba
Vanderlei Indalencio

Thank you, Gilberto ....

I will test ...

: -O
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests