Home>
I am writing a game project. The following question arose. There is a bag with things. Things fall into the bag according to their ID. But if two clothes are identical, then their IDs are also the same. And when a person wants to sell one item, the second is sold automatically without charging the player money. How to delete only the first occurrence by condition in SQL? And leave the second?
ORDER BY `id` DESC LIMIT 1
Tried this, but you quit). I would be grateful for your help.
Thanks. Did.
Ксения Анефина2021-11-17 12:28:54Related questions
- php : DB information is not displayed. mysqli. request for a random withdrawal
- php : Error closing connection after inserting into db?
- Validating data in a form with loading it into a PHP /MySQL database
- PHP: how to send with the same request the rest of an array that does not fall into a condition?
- php : How to make a prepared request correctly?
- PHP authorization system does not work
- php : Reloading the SQL query
- php : I can't add the required entry to the database
- php : Data from input is not accepted
- php : How do I update a record with a duplicate unique cell?
The table must have a field that is unique to the record (primary key). Create, Execute delete exactly on the value of the primary key.
Akina2021-11-17 12:25:19