SQL not a single-group group function

Well the problem simply-put is that the SUM(TIME) for a specific SSN on your query is a single value, so it’s objecting to MAX as it makes no sense (The maximum of a single value is meaningless). Not sure what SQL database server you’re using but I suspect you want a query more like this … Read more

Get total of Pandas column

You should use sum: Then you use loc with Series, in that case the index should be set as the same as the specific column you need to sum: because if you pass scalar, the values of all rows will be filled: Two other solutions are with at, and ix see the applications below: Note: Since Pandas v0.20, ix has been deprecated. Use loc or iloc instead.