clear markdown compare help best fiddles feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3601568 fiddles created (47974 in the last week).

CREATE TABLE tab(ColumnA DECIMAL(10,2), ColumnB DECIMAL(10,2), ColumnC DECIMAL(10,2))
 hidden batch(es)


INSERT INTO tab(ColumnA, ColumnB, ColumnC) VALUES (3, 4, 5),(3, 15, 6),(7, 14, 3)
3 rows affected
 hidden batch(es)


SELECT * FROM tab
ColumnA ColumnB ColumnC
3.00 4.00 5.00
3.00 15.00 6.00
7.00 14.00 3.00
 hidden batch(es)


WITH tab_CTE (ColumnA, ColumnB, ColumnC,calccolumn1) AS -- Define the CTE query. ( Select ColumnA, ColumnB, ColumnC, ColumnA + ColumnB As calccolumn1 from tab ) SELECT ColumnA, ColumnB, calccolumn1, calccolumn1 / ColumnC AS calccolumn2 FROM tab_CTE
ColumnA ColumnB calccolumn1 calccolumn2
3.00 4.00 7.00 1.4000000000000
3.00 15.00 18.00 3.0000000000000
7.00 14.00 21.00 7.0000000000000
 hidden batch(es)