Home > database >  SQL MAX function failed to screening of maximum.
SQL MAX function failed to screening of maximum.

Time:09-16

Consult asked what the following query failed to 'TEST' column shows the maximum? MAX function with wrong?
The following query:

SELECT
WeeksSinceLaunch weeks_in_channel, model, operator

The TEST, the MAX (integer (WeeksSinceLaunch))

The FROM [motorola.com: dataservices: zPlayground M_Science_Native_Phase_II]

Where the operator='AT& T '
='Galaxy AND the MODEL integrated'
GROUP BY 1, 2, 3, 4


CodePudding user response:

You have so many grouping column, of course, you couldn't see effect,

 SELECT WeeksSinceLaunch,MAX (integer (WeeksSinceLaunch) TEST 
The FROM [motorola.com: dataservices: zPlayground M_Science_Native_Phase_II]
WHERE the operator='AT& T '
='Galaxy AND the MODEL integrated'
GROUP BY
WeeksSinceLaunch

CodePudding user response:

If you want to display details and take the maximum don't have to open a window function group by

Max (ss) over (PARTITION BY xx)
  • Related