Re: DMAX equivalent

From: Partha Mandayam (mcp111_at_hotmail.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 14:22:20 -0700

That just means that you are aliasing the columns in the subquery x as
CustomerID, OrderDate, i.e orderdate actually stands for max(orderdate)
from the subquery
so that we can write the join later as
o.CustomerID = x.CustomerID and
o.OrderDate = x.OrderDate

Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • RE: How to find the first occurence, by date, of a record in a ta
    ... You have to use a subquery to get the first date for each value of another ... find the first order for each CustomerID then the query would be like this: ... OrderDate matches the earliest OrderDate for each customer will be returned. ... You can also do it by creating a query grouped by CustomerID and returning ...
    (microsoft.public.access.queries)
  • Query/Table term confusion
    ... select OrderId, OrderDate, O.OrderAmt ... Why does he specify O.OrderAmt yet doesn't use it anymore until the subquery? ...
    (microsoft.public.sqlserver.mseq)
  • Re: random records and paging
    ... RowNum INT NOT NULL IDENTITY, ... CustomerID NCHARNOT NULL, ... EmployeeID INT NOT NULL, ... DECLARE @OrderID AS INT, @OrderDate AS DATETIME, ...
    (microsoft.public.sqlserver.programming)
  • RE: Selecting All Records
    ... It depends on the type of subquery. ... The first query would be: ... (SELECT CustomerID ... Doing the same with the EXISTS predicate the query would be: ...
    (microsoft.public.access.queries)
  • RE: How to find the first occurence, by date, of a record in a ta
    ... find the first order for each CustomerID then the query would be like this: ... OrderDate matches the earliest OrderDate for each customer will be returned. ... You can also do it by creating a query grouped by CustomerID and returning ... "geebee" wrote: ...
    (microsoft.public.access.queries)