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

  • Home
  • SEARCH
  • 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 8597313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:53:09+00:00 2026-06-12T00:53:09+00:00

How would I select c_user_id who have made back to back entries in a

  • 0

How would I select c_user_id who have made back to back entries in a SQL Server 2008 database ?

Preferably people who have made more than 3 back to back entries like pras.chla@gmail.com below (sorting by c_id desc and c_id is an identity column)

c_id    c_user_id             c_entry
1427    xermadr.asdf@me.com   155575
1426    pras.chla@gmail.com   155829
1425    pras.chla@gmail.com   155826
1424    pras.chla@gmail.com   155828
1423    pras.chla@gmail.com   155830
1422    sdfe.qqol@gmail.com   155559 

thanks again ?

  • 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-12T00:53:10+00:00Added an answer on June 12, 2026 at 12:53 am
    ;WITH someUserTableWithOrderNumber as
    (
    SELECT ROW_NUMBER ( )  OVER (order by c_id) OrderNumber, 
        c_id, 
        c_user_id, 
        c_entry 
    FROM someUserTable
    )
    SELECT DISTINCT a.c_user_id
    FROM someUserTableWithOrderNumber a
    JOIN someUserTableWithOrderNumber b on a.OrderNumber = b.OrderNumber + 1 AND a.c_user_id = b.c_user_id 
    JOIN someUserTableWithOrderNumber c on b.OrderNumber = c.OrderNumber + 1 AND b.c_user_id = c.c_user_id 
    JOIN someUserTableWithOrderNumber d on c.OrderNumber = d.OrderNumber + 1 AND c.c_user_id = d.c_user_id 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to select a row from the database based on two input
I am using VS2005 C# and SQL Server 2005. I have an Excel file
I have a table which echos back some SQL counts for each user using
I have a SQL database with has the following: Customer, Item, Clothing and Food.
I would select multiple DOM elements using a typical code such as this: $('#ele1,
How would I select all but the last child using CSS3 selectors? For example,
How would I select only the first level .block and not any of the
How would I select a cell based on a variable beginPosition containing the row
Normally I would do select top (1) * from table where id active =
I would like to select the XPath of a tag and the content of

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.