C
C
cepprice2019-11-18 19:52:16
SQL
cepprice, 2019-11-18 19:52:16

How to split the result of a SQL query?

SELECT * FROM (SELECT sum(val) from vals where (select (id) from val_names));

At the output, I get three numbers (calculated sums) together in descending order. How to divide the received numbers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-11-18
@Rsa97

At the output, you most likely get one single number, because you don’t have any grouping, and by default SUM () sums all the rows in the selection.
Well, the WHERE condition is absolutely incomprehensible to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question