1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

SQL check?

Discussion in 'Programming' started by izlik, Dec 24, 2013.

  1. #1
    Hello
    If i have the following SQL code that i run, how can i make it so that if i run it again it wont to the same changes to the collumns that is already changed one before? my idea was to add a collumn to the rows with a value to check if the code has been run maybe? if yes, how can i make so that the code skips the row if the collumn value is set to 1, a value of 0 means that the code has not been run there yet, let's say we call this collumn "changecheck". also, if "changecheck" do not yet exist for a row, it should be added and treated as if it has not been changed yet, can this be done ? uf yes, i hope someone could help me :)

    UPDATE<yourTableName>SET name = CONCAT(name,'_',original_width,'x',original_height);
    SEMrush
     
    izlik, Dec 24, 2013 IP
    SEMrush
  2. yabsoft

    yabsoft Active Member

    Messages:
    118
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    You can use
    UPDATE<yourTableName>SET name = CONCAT(name,'_',original_width,'x',original_height) WHERE changecheck = 0; 
    Code (markup):
     
    yabsoft, Dec 28, 2013 IP