my Criteria:
I have a distributor (Parent Table), who has many retailer (Child Table). I need last joined retailer name.
i.e
Distributor List | Total No. Retailer | Last Joined Retailer Name
my Query was :
select distName,
count(retailerName) as TotalRetailer,
max(retailerName) as lastPosted,
max(lastjoinRetail) as lastJoindate
from distributor d
right outer join retailer r on d.distNo = r.retailNo
and r.status = 0
and d.status = 0
group by distName.....
I am not getting last joined "Retailer Name"?.