forums › forums › SQLyog › Using SQLyog › Don't Understand How One Update In One Row Will Affect Multiple Ro
- This topic is empty.
-
AuthorPosts
-
-
February 23, 2010 at 2:33 am #11882l333hMember
Hi,
Before I forget, I am using SQLYog Ulitmate v8.2
I have a very simple query that joins a couple of tables; so simple, in fact, I can easily describe it:
I have a table of US Congress members (i.e. 535 rows) and another one of state names (along with an intermediate table which joins the two). My query selects all of the Senators and outputs their name, state, and a boolean “not-up-for-re-election” flag. (The flag is in the politicians table along with their name and other info.)
So I have before me a list of 100 people (out of 535), along with their state and a boolean flag. The weird behavior comes when I try to change the value of the boolean “not-up-for-relection” flag. I can change it, but as soon as I try to navigate away from the field I get a message pop-up that says “This operation will result in 490 rows being updated. Do you want to continue?” It also says I can turn off this warning by unchecking something in the Preferences.
I don't understand this at all: I have a simple list of 100 Senators, each with their own name, state and boolean flag, and when I try to change the value of *one* flag in *one* row that is somehow going to cause 490 rows to be updated?
I keep cancelling the operation because I don't want to destroy any data.
Can someone please give me some insight as to what is going on here?
Thanks,
Larry
-
February 23, 2010 at 4:04 am #30516peterlaursenParticipant
It is explained here:
.. so the WHERE clause mathes that number of rows. To comment further will will need the CREATE statements for the tables as well as the (JOIN-)query you are referrring to.
BTW: Instead of verbose explain it is most often better to paste the SQL – it is non-ambigious and can even be imported/executed at our end.
-
February 24, 2010 at 12:34 am #30517l333hMember
Okay, thanks a lot, Peter – both for the answer and the tip. Next time I'll also check the FAQs before I post a question. (This was my first post and I only checked the Forum.)
— Larry
-
-
AuthorPosts
- You must be logged in to reply to this topic.