× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 7/21/2015 6:15 PM, Hoteltravelfundotcom wrote:
HI I want to use MAX in this SQL. Because we have some cases where
Duplicates
are entered. IN this particular sales data, there is no check in the
application.

MAX() is an aggregate function. The word 'aggregate' is important here
- it is used all over the SQL documentation, so it really helps to
understand what this means. And what it means is that it is a function
that creates one row out of many rows.

How many rows go into each aggregate row? You tell that to SQL with
GROUP BY. The simple rule is that your SELECT needs to have ONLY the
aggregate functions (like MAX) and the columns in the GROUP BY. In
simpler terms, you can't mix detail and summary rows together in one SELECT.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.