0
I need to do the following using a CTE.Imagining two tables with columns:
Articles: Reference, Quantity, Price
Associated References: Reference, Referral
I intend that if there is an associated reference for a reference of the Articles table, that returns the information of the existing associated reference in the Articles table.
Example:
Articles:
Refa, 10, 7€
Refb, 5, 4€
Refc, 2, 10€
Associated References:
Refa, Refc
Outcome will have to be:
Refa, 10, 7€
Refc, 2, 10€
Refb, 5, 4€
Refc, 2, 10€
It is not a solution, as an article may have several references associated with it. And when there are associated references a line should be added with the information of this reference.
– Diogo Fernandes
Post the table columns .
– Edvaldo Lucena