Thanks to both Malcolm for clarifying that variables aren't a part of standard ANSI SQL, and to Eduard for providing a way to rewrite the SQL ... I don't know why that works, but it does! If I write
Select brokercompany, max(statementdate)
...
Group by brokercompany;
without the as...
Terry,
The question was not whether MAX is a standard function, but the way it is used in the SQL statement I included. In other words, I have seen SQL like
select max(statementdate)
which would return the most recent statementdate, but I hadn't seen
select
brokercompany, statementdate =...
A rather simplistic question - in the following SQL statement, is it standard ANSI SQL to be able to select the max(statementdate) for each record as shown below? or is that an "extension" allowed by the particular DBMS? (in this case Sybase's Transact SQL) I haven't come across this...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.