Last active
August 29, 2015 14:07
-
-
Save ssx/ddd2f6127c00e18ef38e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Answers Needed: | |
1. What Name generally has the most spaces | |
2. What time of day is 'name' likely to have spaces | |
3. What name generally has the least spaces | |
Date Time Name Spaces | |
2014-10-01 10:00:00 Item 1 753 | |
2014-10-01 10:00:00 Item 2 436 | |
2014-10-01 10:00:00 Item 3 86 | |
2014-10-01 10:00:00 Item 4 234 | |
2014-10-01 11:00:00 Item 1 323 | |
2014-10-01 11:00:00 Item 2 578 | |
2014-10-01 11:00:00 Item 3 565 | |
2014-10-01 11:00:00 Item 4 654 | |
2014-10-01 12:00:00 Item 1 345 | |
2014-10-01 12:00:00 Item 2 11 | |
2014-10-01 12:00:00 Item 3 121 | |
2014-10-01 12:00:00 Item 4 321 | |
2014-10-01 13:00:00 Item 1 221 | |
2014-10-01 13:00:00 Item 2 4321 | |
2014-10-01 13:00:00 Item 3 421 | |
2014-10-01 13:00:00 Item 4 3 |
select time
where name = 'Item 2' and spaces > 0
select name, sum(spaces)
from xxx
group by name
order by sum(spaces) asc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this for most spaces ??
select sum(spaces) from xxx
group by name
order by sum(spaces) desc
limit 1