I cannot put result in SQL table

Asked

Viewed 37 times

0

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

result1 = x

But it didn’t 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);
  • Thanks more I’ve solved

1 answer

2

You have to use the clause into:

 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);
  • Thanks more friend I’ve solved otherwise.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.