Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I have a query where I update a record where id = 0; however 0 value not exists in my table A. and sql show me that 0 rows affected What is the meaning of this?

What I have tried:

I think it occurs when query syntax true but doesn't matter some value exist or not.
Posted
Updated 22-Oct-22 4:27am
v2

Quote:
sql show me that 0 rows affected What is the meaning of this?
It means exactly what it says: your SQL command did nothing because there was no row with id=0, so zero rows were changed.
 
Share this answer
 
Quote:
I have a query where I update a record where id = 0; however 0 value not exists in my table A.

You don't see a problem with this?

If you don't see the problem, you really need to go back to the very basics of learning relational databases and SQL.
 
Share this answer
 
Comments
vor_zakon_developer 22-Oct-22 15:02pm    
@Date Kreskowiak I watched many tutorials about rdbms or sql there are not any concept that teach us in this topic. to better understand I ask the question because. so what? as I understand you didn't understand as well didn't you?
Dave Kreskowiak 22-Oct-22 15:09pm    
Actually, I understood it quite well at the beginning, and yes, every tutorial DOES teach this concept. It's the entire basis of what and how relational databases work.

ANY documentation and tutorial on updating a row in a table will always refer to WHERE clauses that use an ID, or Primary Key, to identify and work with specific rows in a table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900