How to use a calculated column to calculate another column in the same view

后端 未结 5 745
故里飘歌
故里飘歌 2020-11-28 07:32

I am hoping you can help with this question. I am using Oracle SQL (SQL Developer for this view)...

If I have a table with the following columns:

  • Co
5条回答
  •  臣服心动
    2020-11-28 08:24

    You have to include the expression for your calculated column:

    SELECT  
    ColumnA,  
    ColumnB,  
    ColumnA + ColumnB AS calccolumn1  
    (ColumnA + ColumnB) / ColumnC AS calccolumn2
    

提交回复
热议问题