AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help (Mysql tables) (https://forums.alliedmods.net/showthread.php?t=326849)

jugule 08-19-2020 16:08

Help (Mysql tables)
 
Hi, how can I move a column from this table: Example1 and then move it to Example2? (in plugin)

and then delete the column from the old table if it has been moved to the new table.

Bugsy 08-19-2020 20:27

Re: Help (Mysql tables)
 
Quote:

Originally Posted by jugule (Post 2714845)
Hi, how can I move a column from this table: Example1 and then move it to Example2? (in plugin)

and then delete the column from the old table if it has been moved to the new table.

SELECT Column1 FROM table1;

In your results handler:

INSERT INTO table2 (Column2) VALUES (col1_value);

Then delete

ALTER TABLE table1
DROP COLUMN Column1;

jugule 08-19-2020 20:39

Re: Help (Mysql tables)
 
Quote:

Originally Posted by Bugsy (Post 2714873)
SELECT Column1 FROM table1;

In your results handler:

INSERT INTO table2 (Column2) VALUES (col1_value);

Then delete

ALTER TABLE table1
DROP COLUMN Column1;

Thanks !!


All times are GMT -4. The time now is 13:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.