17 lines
356 B
MySQL
17 lines
356 B
MySQL
|
|
||
|
-- add a col for the wolves ID
|
||
|
ALTER TABLE accounts ADD COLUMN id_wolves integer DEFAULT 0;
|
||
|
|
||
|
-- fill in the values
|
||
|
UPDATE accounts
|
||
|
SET id_wolves=(
|
||
|
SELECT id_wolves
|
||
|
FROM accounts_wolves
|
||
|
WHERE accounts.mail=accounts_wolves.email
|
||
|
)
|
||
|
WHERE (
|
||
|
SELECT id_wolves
|
||
|
FROM accounts_wolves
|
||
|
WHERE accounts.mail=accounts_wolves.email
|
||
|
) IS NOT NULL
|