Preface: That's one of the SQL pitfalls I've stumbeld over too often...
Well, sometimes I've to turn expressions from an ordinary programming language into a SQL query, and sometimes these expressions contain the classical scalar max() function, say like "where max(expr1, expr2) > 0".
The following (absolutely senseless) query would be a sample:
select * from systab where max(table_page_count, ext_page_count) > 10;
Of course, using max() that way in a SQL query is doomed to fail, as MAX() is an aggregate function and works on rows of data, not on two (or more) separate expressions, so this raises
Question: Is there a way to use max() as intended here?
Well, you cannot use MAX() for that - but of course SQL Anywhere has according support:
select * from systab where greater(table_page_count, ext_page_count) > 10
And now I hope I won't forget that anymore:)