MySQL: Computed Column

前端 未结 4 1060
再見小時候
再見小時候 2020-12-03 16:42

I\'m just started using SQL and ran into a problem.

In my database, I presently have two tables, Cinemas and Theatres. I\'m trying to create a column \"# of Theatre

4条回答
  •  悲&欢浪女
    2020-12-03 17:06

    In mysql you if you want an actual column you would

    • create it as any column
    • make sure it is consistent by creating a trigger on theatre table that will update the column ever time a row is added or deleted

提交回复
热议问题