Hi there let me describe my problem quickly
I have 3 tables. Lets Say Contact, Order, Transaction and there are relations accordingly
Contact: Contact Id, FirstDate, LastDate
1-N Relation On ContactId
Order: OrderId, ContactId, OrderTotal
1-1 Relation On OrderId
Transaction: OrderId, DateOfIssue
My question is this:
I want to Update All Contacts' FirstDate and LastDate fields accordingly in one query.
I mean If ContactA has 5 Orders (and 5 Transactions) I want to set the date of first transaction as FirstDate and date of last transaction as LastDate in Contact.