Hi,I have customer table and order table and both consists of customerID columnwhich is primary key for customer table.I want to write a query which we will give all the recent order for each customer but restricting to the most recent order only.For Example:Customer Table:CustomerID 123Order TableOrderID CustomerID OrderDate Amount1 1 2012-11-27 3002 1 2012-11-28 3503 2 2012-11-28 400Result Set Needed:CustomerID OrderDate Amount1 2012-11-28 3502 2012-11-28 400NOTE: I need this T-SQL query without using CTE or Ranking Function like RANK(), ROW_NUMBER(),etc...Thank you in advance.
↧