Answer the question
In order to leave comments, you need to log in
How to write nested query in select?
There is a need for this query:
select (select sum(rashody) from transport_reestr where transport_type=‘taxi’)/ sum(rashody) from transport_reestr
Answer the question
In order to leave comments, you need to log in
Need to add GROUP BY
SELECT (SELECT SUM (RASHODY)
FROM TRANSPORT_REESTR
WHERE TRANSPORT_TYPE = 'TAXI') / SUM (RASHODY)
FROM TRANSPORT_REESTR
GROUP BY НАЗВАНИЕ_ПОЛЯ;
SELECT (SELECT SUM (RASHODY)
FROM TRANSPORT_REESTR
WHERE TRANSPORT_TYPE = 'TAXI') /
(SELECT SUM (RASHODY)
FROM TRANSPORT_REESTR)
FROM DUAL;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question