Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Don't Understand How One Update In One Row Will Affect Multiple Ro

forums forums SQLyog Using SQLyog Don't Understand How One Update In One Row Will Affect Multiple Ro

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #11882
      l333h
      Member

      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

    • #30516
      peterlaursen
      Participant

      It is explained here:

      http://www.webyog.com/faq/content/28/70/en/i-only-changed-one-row-of-data-but-sqlyog-wants-to-update-more-rows-in-the-database-why.html

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

    • #30517
      l333h
      Member

      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

Viewing 2 reply threads
  • You must be logged in to reply to this topic.