▲ | mbb70 16 hours ago | |||||||||||||||||||||||||
The very next ask will be "order the zipcodes by number of customers" at which point you'll be back to aggregations, which is where you should have started | ||||||||||||||||||||||||||
▲ | wvbdmp 16 hours ago | parent | next [-] | |||||||||||||||||||||||||
Anti-Patterns You Should Avoid: overengineering for potential future requirements. Are there real-life cases where you should design with the future in mind? Yes. Are there real-life cases where DISTINCT is the best choice by whatever metric you prioritize at the time? Also yes. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | majormajor 15 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
Here we start to get close to analytics sql vs application sql, and I think that's a whole separate beast itself with different patterns and anti-patterns. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | bandrami 11 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
I do reporting, not application development. If somebody wants to know different information I'd write a different query. | ||||||||||||||||||||||||||
▲ | kristjansson 16 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
Whole seconds will have been wasted! | ||||||||||||||||||||||||||
▲ | sql_nitpicker 16 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
distinct seems like an aggregation to me | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | edoceo 16 hours ago | parent | prev [-] | |||||||||||||||||||||||||
count(id) group by post_code order by 1 |