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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:27:05+00:00 2026-05-26T10:27:05+00:00

How to I retrieve the second, third .. entries in a database. I don’t

  • 0

How to I retrieve the second, third .. entries in a database. I don’t want to use the auto incrementing id generated by rails.

As I am deleting entries from my database, so the ID continues to increase.

So my DB would have

id : 210 (Even thought it's currently the first value)
id : 211 (Even thought it's currently the second value)

I know “Phone.first” will return the first how do I get the second.

Sub Question-
Destroy_all/delete_all –
only removes the item, Can I remove all entries from the DB and have the DB id’s start from one without dropping the table. As I ran into problems.

  • 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-26T10:27:06+00:00Added an answer on May 26, 2026 at 10:27 am

    Say you want the fourth user:

     @users = User.limit(4)
     @fourth_user = @users[3]
    

    Concerning your second question, destroy_all should do the trick since it triggers all callbacks. Be sure to add :dependent => :destroy in your relationships.

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

Sidebar

Related Questions

$(t).html() returns <td>test1</td><td>test2</td> I want to retrieve the second td from the $(t) object.
From the XML below I'm trying to retrieve the second element in the sequence.
To retrieve k random numbers from an array of undetermined size we use a
Can a Linq query retrieve BLOBs from a Sql Database? And how do they
I want to retrieve the recently viewed pictures from IE. I know that all
I want to retrieve the current second in the Youtube video on my site
I want to select and retrieve all the contents from an NSDictionary . I
I retrieve .jpgs from my server and load them within my as3 app. I
I'm trying to retrieve a file from a server using SFTP (as opposed to
I know the class name, say MyClass and want to retrieve the Class object,

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.