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 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

Related Questions

I inherited MYSQL database that has lots of tables with data like CREATE TABLE
I have a table that has redundant data and I'm trying to identify all
My table has a timestamp column named RowVer which LINQ maps to type System.Data.Linq.Binary.
I am displaying a scrolled data table in a web page. This table has
I'm looking into horizontal partitioning for a table that has time-series data in it.
I have a problem. Imagine this data model: [Person] table has: PersonId, Name1 [Tag]
If a table has a rowversion column in it and you make an update
I would like to update my SQL lite database with the native update-method of
I'm currently working with MS SQL 2005, and have a table that has 17
I'm trying to design some tables to store some data, which has to be

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.