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 7646195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:08:44+00:00 2026-05-31T10:08:44+00:00

The following query should return 180 rows (as it is the total number of

  • 0

The following query should return 180 rows (as it is the total number of minutes between 2012-03-13 00:00 and 2012-03-13 03:00) but always returns 171 rows. I found out that when I use interval in a SELECT query, I can always get 171 rows at max. Here is the query:

SET @num = -1;
SELECT @num:=@num+1 AS AddInterval, DATE_ADD('2012-03-13 00:00', interval @num minute) AS MyDate FROM MyTable HAVING MyDate <= '2012-03-13 03:00' LIMIT 0, 180

Also, the following very simple query returns 171 rows too:

SELECT COUNT(DATE_ADD('2012-03-13 00:00', interval 1 minute)) FROM MyTable;

Is there any mysql configuration affects this, a limit or am I doing something wrong?

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-31T10:08:45+00:00Added an answer on May 31, 2026 at 10:08 am

    You’re selecting from a table – if that table only has 171 rows, then you’ll only get 171 increments. SQL will not create the missing rows for you, even if you specify a limit higher than what’s available.

    This is true even though you’re not actually selecting any actual fields from that table. You’re selecting only generated values – but you’re still limited to the number of rows in the underlying table.

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

Sidebar

Related Questions

I have the following query which should return no rows, but returns 4: var
The following query should return around 1159 results but only returns around 880 results;
I have the following query (which should return a scalar/numeric), But I still get
The following query returns the total amount of orders, per week, for the past
we need to implement the following query in such a way that we should
The following query returns strange results for me: SELECT `Statistics`.`StatisticID`, COUNT(`Votes`.`StatisticID`) AS `Score`, COUNT(`Views`.`StatisticID`)
The following query works on Oracle 10.2.0.1.0 on windows,but doesn't work on Oracle 10.2.0.2.0
The following query takes more than 3 minutes to run because tables contain massive
My SQL-Query should return a previous record(Claim). Previous means that it has a different
Revised Query.. the [Id] column is unique to all records.. the query should return

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.