- Edited
So here I am, sitting at work wondering about everything there is to life. All of the sudden I remembered a question I had when I first was studying database at the university. A question that I'm not being able to answer to this date. The question goes like this: (EMBRACE YOURSELF)
How does an SQL UPDATE query knows when to update a bunch of records with the same value, for example,
and updating each record with its own modified value, for example,
That question led me to think that I have no idea how an actual update query works. Is just enough for the parser to see that I'm appending to the field and therefore updates each row accordingly?
(END OF EMBRACING YOURSELF)
Does what I just wrote makes any sense whatsoever? WHO AM I?
How does an SQL UPDATE query knows when to update a bunch of records with the same value, for example,
UPDATE Table1 SET Field = value
this will update the table1's filed value to value (all the rows with the same value), and updating each record with its own modified value, for example,
UPDATE Table1 SET Field = Field + 'something'
this will update table1's field value according to its current value (each row will have a distinct value).That question led me to think that I have no idea how an actual update query works. Is just enough for the parser to see that I'm appending to the field and therefore updates each row accordingly?
(END OF EMBRACING YOURSELF)
Does what I just wrote makes any sense whatsoever? WHO AM I?