Web Analytics Made Easy -
StatCounter 3 Joined Updates, same format, 2 working 1 not - CodingForum

Announcement

Collapse
No announcement yet.

3 Joined Updates, same format, 2 working 1 not

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3 Joined Updates, same format, 2 working 1 not

    Okay,

    3 joined updates same format, first 2 work last one doesn't can't for the life of me figure out why.

    1.This works
    Code:
    UPDATE contacts, campaign_log
    SET contacts.invalid_email=1
    WHERE contacts.id=campaign_log.target_id
    AND campaign_log.activity_type="invalid email"
    2.This works
    Code:
    UPDATE campaign_log, contacts
    SET campaign_log.deleted=1
    WHERE contacts.id=campaign_log.target_id
    AND contacts.agency_name="FSBO"
    3.This only returns an empty set
    Code:
    UPDATE campaign_log, emails
    SET campaign_log.activity_type="invalid email"
    WHERE campaign_log.related_id = emails.id
    AND emails.description_html = "X"
    While this Works
    Code:
    UPDATE campaign_log, emails
    SET campaign_log.activity_type="invalid email"
    WHERE campaign_log.related_id = emails.id
    And this works
    Code:
    SELECT*FROM emails
    WHERE emails.description_html = "X"
    So what gives???

  • #2
    Hi,

    The first answer that springs to my mind is, does the following query return a value of zero?

    Code:
    SELECT count(0) from campaign_log, emails
    WHERE campaign_log.related_id = emails.id
    AND emails.description_html = "X";
    If so, then that's the problem.

    Mike.
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!

    Comment


    • #3
      Duhhhhhh (as a bit of droool rolls down my chin...)
      Of course 149 qualifying records DID exist in campaign_log.
      Let the be a lesson to me!!! Tired? Eyes Burning? Drooling????

      GO TO BED BEFORE YOU DELETE SOMETHING YOU SHOULDN'T

      I was so fried, was sure it was something I was missing in the queary.
      GRRRRRRRR

      Comment


      • #4
        That's what backups are for!
        Die Welt ist ein Irrenhaus und hier ist die Zentrale!

        Comment

        Working...
        X