53°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Aaron Parecki https://aaronparecki.com/   •   Sep 16
    Any clever SQL people out there? Given the raw data on the left, (a table of test results) how do I write a SQL query to give me the results on the right, (the results grouped by date as well as grouped by result)?
    Aaron Parecki
    That was fast, we have a winner!

    SELECT `date`, SUM(IF(success, 1, 0)) AS `success`, SUM(IF(success, 0, 1)) AS `fail`
    FROM `results` GROUP BY `date`

    https://twitter.com/jkphl/status/1570804284060475392
    Portland, Oregon, USA • 58°F
    Fri, Sep 16, 2022 9:01am -07:00
    10 likes 3 replies
    • Anthony Sorace
    • Emacsen
    • Walter
    • m_nt_rpt
    • Readymix
    • Matthias Ott
    • Joschi Kuphal 吉
    • Jan Sauer
    • Zack Fernandes
    • Wesley Pribadi
    • Aaron Parecki twitter.com/aaronpk
      my problem was I couldn't even figure out how to ask this with words so I wasn't sure what to search for!
      Fri, Sep 16, 2022 4:24pm +00:00 (via brid.gy)
    • Guillermo Arellano twitter.com/MeetGuillermo
      Who needs StackOverflow when you have Twitter?
      Fri, Sep 16, 2022 4:22pm +00:00 (via brid.gy)
    • Joschi Kuphal 吉 twitter.com/jkphl
      Actually, the first IF isn't necessary, and I didn't care about stripping the time part, so @paw's suggestion is a bit more accurate:
      Fri, Sep 16, 2022 4:10pm +00:00 (via brid.gy)
Posted in /replies using quill.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv