Article 5PNJ4 How to add new columns into SQL Table those to be named as values from existing column

How to add new columns into SQL Table those to be named as values from existing column

by
6502
from LinuxQuestions.org on (#5PNJ4)
I have an existing table TEAMS :
Code:TEAM_ID,
TEAM_NAME,
MATCH_COUNT,
SCORED_PLUS,
SCORED_MINUS,
SCORED_SUM,
POINTS_WONThe column TEAM_ID contains following numbers:
Code:1
2
4
5
6
7
10
11
12
17
22
23
24
25I need to get these numbers from column TEAM_ID and to add new columns into table TEAMS :
Code:TEAM_ID,
TEAM_NAME,
MATCH_COUNT,
SCORED_PLUS,
SCORED_MINUS,
SCORED_SUM,
POINTS_WON,
1,
2,
4,
5,
6,
7,
10,
11,
12,
17,
22,
23,
24,
25 something like next code :
Code:ALTER TABLE `TEAMS` ADD COLUMNS SELECT TEAM_ID FROM `TEAMS` smallintThe code does not work. How to add new columns into SQL Table, as I described above ?latest?d=yIl2AUoC8zA latest?i=sZafT7aQgk8:IGhFtETSrbY:F7zBnMy latest?i=sZafT7aQgk8:IGhFtETSrbY:V_sGLiP latest?d=qj6IDK7rITs latest?i=sZafT7aQgk8:IGhFtETSrbY:gIN9vFwsZafT7aQgk8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments