Thread: SQL code help
View Single Post
  #1  
Old 01-13-2015, 04:24 PM
pythag
Sarnak
 
Join Date: Jan 2012
Posts: 56
Default SQL code help

Hi
I am playing around with a solo server for now, and wish to attemp a global DB change (to see if I can).
I want to update an entry in table1 based on an entry in table2

Code:
UPDATE lootdrop_entries SET chance = 50 IF items COLUMN name = *defiant*;
- I know its very wrong

ie if in the items table column name it says defiant then change the lootdrop_entries table column chance to be 50%

I know the tables are linked by item_id so they should connect

Also would this back up a single table prior to me messing with it?
Code:
SELECT * INTO backuplootdrop_entries FROM lootdrop_entries;
Again any help gratefully received
Reply With Quote