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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:50:27+00:00 2026-06-04T10:50:27+00:00

Is it possible to do a paging type of query where my main query

  • 0

Is it possible to do a paging type of query where my main query has a group by clause in it.

How would I implement this (if this is even possible)

Example query:

SELECT * FROM TABLE_NAME GROUP BY DATEPART(YEAR,DATE), DATEPART(YEAR,MONTH)

Can I possibly get the result via reading it page by page?

…and while on the topic, can I also get the total number of rows that would be retrieved without putting it inside a sub query?

  • 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-06-04T10:50:28+00:00Added an answer on June 4, 2026 at 10:50 am

    Use ROW_NUMBER & CTE feature of SQL Server as mentioned below.

    WITH CTE AS (
    SELECT     A,B,C
               ROW_NUMBER() OVER (ORDER BY  columnName) RN
    )
    SELECT * FROM CTE WHERE RN Between 1 and 10
    

    Please refer http://sqlserverplanet.com/sql/pagination-using-rownumber for more details.

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

Sidebar

Related Questions

Is it possible to implement custom paging for repeater using ObjectDataSource's: EnablePaging=true MaximumRowsParameterName=maximumRows StartRowIndexParameterName=startRowIndex
I want to implement paging in Repeater via JQuery. Is it possible? If yes,
I was wondering if it's possible to implement paging and sorting of data using
This seems possible, but I'm having a little trouble figuring out how to implement
Possible Duplicates: Why is lock(this) {...} bad? In C# it is common to use
I want implement paging same as safari in iphone.When user touch below button of
I have developed a paging control that I would like to use in a
i'm building a website which has a parent-child Paging structure. I'm looking for a
The following query is pretty simple. It selects the last 20 records from a
Is it possible to compile queries which will be used with paging and sorting?

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.