I have a mysql tables which has column for salary. I was able to compute for the columns 18% and 9% value by using:
SELECT SALARY, SALARY * .09 as ‘PS’, SALARY * .12 as ‘GS’ FROM database.table;
-
How would I add an additional column on this table based on the result of the sql statement? What I meant is I wanted to add columns ‘PS’ and ‘GS’ to my table.
-
If this is possible on the same table, how would I create another table based on the result of the sql statement (new table containing PS and GS) through sql script/statement.
1) In order to add an additional column to the table you must use the alter command.
2) You must first create the table and then insert into it your previous query.