Can not put result in SQL table

0

I want to put the result of this equation there where it is 'RESULT1' already tried to do

result1 = x

More did not work, I have little experience with SQL yet;

SELECT (VA * VB) / VC    
   FROM (SELECT 5 AS VA, 10 AS VB, 5 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 1 AS VA, 1  AS VB, 1 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 3 AS VA, 10 AS VB, 2 AS VC, X AS RESULT1 FROM DUAL);

I tried to do so,

   SELECT RESULT1 = (VA * VB) / VC    
   FROM (SELECT 5 AS VA, 10 AS VB, 5 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 1 AS VA, 1  AS VB, 1 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 3 AS VA, 10 AS VB, 2 AS VC, X AS RESULT1 FROM DUAL);
    
asked by anonymous 12.02.2018 / 01:32

1 answer

2

You need to use the into clause:

 SELECT (VA * VB) / VC   into RESULT1 
   FROM (SELECT 5 AS VA, 10 AS VB, 5 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 1 AS VA, 1  AS VB, 1 AS VC, X AS RESULT1 FROM DUAL UNION
         SELECT 3 AS VA, 10 AS VB, 2 AS VC, X AS RESULT1 FROM DUAL);
    
12.02.2018 / 09:09