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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:21:11+00:00 2026-05-11T00:21:11+00:00

My table has data like so products_parent_id | products_quantity 2 5 2 7 2

  • 0

My table has data like so

  products_parent_id | products_quantity         2               5         2               7         2               9         2               4   

My SQL statement looks like so (so far):

UPDATE ' . TABLE_PRODUCTS . ' SET products_quantity = products_quantity +' . $order['products_quantity'] . ', products_ordered = products_ordered - ' . $order['products_quantity'] . ' WHERE products_parent_id = ' . (int)$order['products_id'] 

Now what I want to do, is update only say the 3rd occurrence of products_parent_id (in this case, 3rd from the top is 9)

To SELECT the 3rd occurrence, I used this at the end of my statements LIMIT($grade, 1)

Is there a way to UPDATE using MySQL but only the 3rd/4th/etc occurrence? Will it be reliable?

Thank you

  • 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. 2026-05-11T00:21:12+00:00Added an answer on May 11, 2026 at 12:21 am

    Short Answer: No

    Long Answer:

    Sort Of. Because the order the rows are returned is not defined by SQL.
    Technically two different requests to the DB could return the rows in a different order. So even if you update the third row, which is the third will depend on the implementation.

    The only way to mitigate this is to apply a specific ordering to the rows. (Order by)

    I don’t think it is part of the language specification but most SQL implementations allow you to get a particular row from a query. I am not sure what the MYSQL specific details are but a quick google got this page:

    http://forums.mysql.com/read.php?10,36490,36511

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

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer What you might want to do is to build your… May 11, 2026 at 3:52 pm
  • added an answer Nevermind, we solved the issue. It seems when you have… May 11, 2026 at 3:52 pm
  • added an answer I'm not sure what 'it fails' means, so I'll just… May 11, 2026 at 3:52 pm

Related Questions

I have been tasked with developing a new retail e-commerce storefront for my current
Each product in my database can have at least three and sometimes four or
I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g.
I have to write a component that re-creates SQL Server tables (structure and data)

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.