1

Topic: SQL request

Misters the small help with sql Select query, good afternoon, is necessary.
Is  with following request (on a screen).
Whether it is possible to add somehow in request summation? For example that the total t_kg on -92, -93 and  was deduced?

2

Re: SQL request

To envelop adding request... Or GROUP BY WITH ROLLUP.

3

Re: SQL request

Whether

mbs92 wrote:

It is possible to add somehow in request summation? For example that the total t_kg on -92, -93 and  was deduced?

give an example that should turn out.

4

Re: SQL request

[/quote] give an example that should turn out. [/quote]
By council Akina made with ROLLUP, the following turned out. But whether it is possible to deduce the total of a separate column instead of a line?

5

Re: SQL request

6

Re: SQL request

mbs92;
SUM () OVER (PARTITION BY)

7

Re: SQL request

Whether

mbs92 wrote:

it is possible to deduce the total of a separate column instead of a line?

you understand, what in ONE record obtain the data of DIFFERENT levels of grouping? That, to put it mildly, forces the unfortunate logic...

8

Re: SQL request

mbs92 wrote:

it is passed...
By council Akina made with ROLLUP, the following turned out. But whether it is possible to deduce the total of a separate column instead of a line?

explicitly in digits write that you want to receive on an example from your first post.

9

Re: SQL request

The grandfather;
SUM (t_kg) OVER (PARTITION BY t_marka)