Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3950708
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:38:37+00:00 2026-05-20T01:38:37+00:00

I would think this would be easy for an SQL-alike! What I want is

  • 0

I would think this would be easy for an SQL-alike! What I want is the GQL equivalent of:

select count(*) from foo;

and to get back an answer something similar to:

1972 records.

And I want to do this in GQL from the “command line” in the web-based DataStore viewer. (You know, the one that shows 20 at a time and lets me see “next 20”)

Anyway — I’m sure it’s brain-dead easy, I just can’t seem to find the correct syntax. Any help would be appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:38:38+00:00Added an answer on May 20, 2026 at 1:38 am

    As it’s stated in other questions, it looks like there is no count aggregate function in GQL. The GQL Reference also doesn’t say there is the ability to do this, though it doesn’t explicitly say that it’s not possible.

    In the development console (running your application locally) it looks like just clicking the “List Entities” button will show you a list of all entities of a certain type, and you can see “Results 1-10 of (some number)” to get a total count in your development environment.

    In production you can use the “Datastore Statistics” tab (the link right underneath the Datastore Viewer), choose “Display Statistics for: (your entity type)” and it will show you the total number of entities, however this is not the freshest view of the data (updated “at least once per day”).

    Since you can’t run arbitrary code in production via the browser, I don’t think saying “use .count() on a query” would help, but if you’re using the Remote API, the .count() method is no longer capped at 1000 entries as of August, 2010, so you should be able to run print MyEntity.all().count() and get the result you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would have thought that this would be an easy thing to do, but
you would think this would be obvious, but searching through documentation, SAP forums, Googling,
How can I force validation when user clicks button? One would think this should
What is the function of the namespace here? I would think in this simple
Sorry if this is duplicate,I would think it would be but couldn't find anything.
How would I do this? I think this has something to do with editing
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
I would like to do the following but I don't think this will work:
This is something that I think would be very useful. Basically, I'd like there
See what you think of this line of code: if ([pickerViewController.picker.bvc.currentResolve.name isEqualToString:message]) ... Would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.