I am creating a stored procedure where I would like to bring back just the first record from each match up instead every record that matches.
I have written the following code so far:
SELECT
Tenant.FirstNames AS LeadTenantFirstName, Tenant.LastNames AS LeadTenantLastNames,
Deposit.CertificateNumber AS DPCNumber
FROM tblMemberPropertyDepositTenantHistory AS Tenant
INNER JOIN tblMemberPropertyDeposits AS Deposit
ON Tenant.MemberPropertyDepositID = Deposit.MemberPropertyDepositID
The problem is that it will bring back a record for every tenant in the query for a certificate, but I would like to bring back just the first tenant created for each certificate?
Any ideas?
If I understand you right you need something like this: