For example, I have the following table:
CREATE TABLE `test` (
`total_results` int(10) unsigned NOT NULL,
`num_results_as_expected` unsigned int(10) NOT NULL,
) ;
I would like to add another column to the table without using VIEW to add a percentage:
(num_results_as_expected/total_results)*100
Is this possible without using VIEW?
- Explanation
. I know this is possible using select statent, but I would like to add this to the CREATE TABLE statement so that the column is accessible to anyone who accesses the table.
Clarification 2: Is a trigger the right way to do this? This will essentially store duplicate information in a column.
Peterpan
source
share