Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Learning to Count with PostgreSQL

Evan Goodberry
Wednesday, August 29, 2012

Interestings

  • PostgreSQL COUNT(*) OVER()

Sometimes when you’re paginating you have to run 2 queries, one for the first n records, and another for the total count.

It’s possible to get both in one query using OVER().

SELECT , COUNT() OVER() as total_count FROM blog_posts ORDER BY created_at DESC LIMIT 25;

Each record will come back with a total_count attribute, so you will have to look at one of the records to figure out the count.

http://www.postgresql.org/docs/9.1/static/tutorial-window.html

  • Good article on quick Twitter Bootstrap style customizations

Some good links and resources in this article, including a sweet color scheme generator, FontAwesome, Kickstrap, and more.

Events

  • Wednesday: Enyo Bootcamp

Come to the Enyo Bootcamp workshop to learn everything you need to know to begin creating cross-platform cross-browser Web applications with this exciting framework. There will be a brief presentation followed by Q&A with some of the Developer Relations Engineers. Attendees should be somewhat familiar with HTML, JavaScript, and CSS to get the biggest benefit. Visit http://enyojs.com/ to get a leg up or come prepared to have your mind blown.

To get into the spirit of working with the framework, read about Xtuple’s recent experience at http://www.xtuple.org/node/5000 and be inspired by the ease of Enyo!

Eventbrite Invite: http://enyobootcampnewyorkcity.eventbrite.com/

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Evan Goodberry

Evan Goodberry
New York

Recent Posts

  • Hardware Hacking Meeting
  • [Standup][NY] 08/27/12: Sweet Monday
Subscribe to Evan's Feed

Author Topics

  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >