因此,假设我们有一个名为Prices
和 列Price1
的表Price2
,并且我想创建一个名为的视图,其中一个名为Totals
的列在表上PriceTotals
添加Price1
和Price2
,第二个名为的列PriceCut
简单地将PriceTotals
视图除以 2:
create view `Totals` as
select
`Price1` + `Price2` as `PriceTotals`,
/**Put column definition here that divides PriceTotals by 2**/ as `PriceCut`
from `Prices`;
我该怎么做?