I have 3 tables in a MySQL database
user
user_id, (PK)
email
agreement_user
agreement_user_id, (PK)
user_id, (FK user.user_id)
details
contract
contract_id, (PK)
agreement_user_id, (FK agreement_user.agreement_user_id)
details
What should be the query to get contract.details and user.email given a contract_id
2
Answers
maybe you can try
Try this
Replace @contractId with your value