1
Hello, Community!
I need help with the logic of a consultation I have to do on SQL Server 2012.
Well, I have three tables: [1'] operacao_apf
; [2] operacao_contrato
; and, [3] operacao_detalhe
.
What I need to do: in [1'], I need to take the name of any operation, and, by name, I have to go in [2] and select all contracts related to this operation. After selecting all contracts in [2] related to the transaction researched on 1, i need to go into [3] and select all the details related to each contract of [2] related to the 1.
Scheme:
Note that tables are always associated with 1:N
from left to right. An operation can have multiple contracts and each contract can have multiple details.
What I want to do is generate a report with this, but I need to understand the logic of SQL Server 2012 to get started.
Perfect! Thank you very much! It worked!
– StillBuggin