#### Topic: As two select under one from

experts . Prompt a question on such subject... There are two requests addressing to one table table

wrote:

select count (par1), count (par2) from table
union all
select count (par3), count (par4) from table

Whether it is possible as that to tire out these  under one from???? Tried to explain more clearly but not ))

#### Re: As two select under one from

``select count (par1), count (par2), count (par3), count (par4) from table``

#### Re: As two select under one from

And at you everywhere one

``````WITH T AS
(
SELECT 1 par1, 2 par2, 3 par3, 4 par4 FROM dual UNION ALL
SELECT 11 par1, 12 par2, 13 par3, 14 par4 FROM dual
)
SELECT SUM (CASE WHEN ID=1 THEN par1 WHEN ID=2 THEN par2 END) s1;
SUM (CASE WHEN ID=1 THEN par3 WHEN ID=2 THEN par4 END) s2
FROM T;
(SELECT ROWNUM ID FROM dual connect BY ROWNUM &lt;3) tbl
GROUP BY ID``````

#### Re: As two select under one from

Children for stupid on an example please (((
select
sum (case when v_f10=1 and floor (p1_101/1000) not in (1,2) then 1 else 0 end) gr1;
sum (case when v_f10=2 and p11_25 in (54,55) or (p11_25 in (49,50) and rab2 in (54,55)) then 1 else 0 end) gr2;
sum (case when p11_25=42 or (p11_25 in (49,50) and rab2=42) then 1 else 0 end) gr3
from f117
where mod (p1_10,10) in (4,5,7,24)
union all
select
sum (case when v_f10=1 and floor (p1_101/1000) not in (1,2) then 1 else 0 end) gr1;
sum (case when v_f10=2 and p11_25 in (54,55) or (p11_25 in (49,50) and rab2 in (54,55)) then 1 else 0 end) gr2;
sum (case when p11_25=42 or (p11_25 in (49,50) and rab2=42) then 1 else 0 end) gr3
from f117
where mod (p1_10,10) in (4,5,7,24)
and p1_10 in (4,5)
union all
select
sum (case when v_f10=1 and floor (p1_101/1000) not in (1,2) then 1 else 0 end) gr1;
sum (case when v_f10=2 and p11_25 in (54,55) or (p11_25 in (49,50) and rab2 in (54,55)) then 1 else 0 end) gr2;
sum (case when p11_25=42 or (p11_25 in (49,50) and rab2=42) then 1 else 0 end) gr3
from f117
where mod (p1_10,10) in (4,5,7,24)
and d111 in (20,30,40,72,73,74,75,76,77)
GR1 GR2 GR3
-------------------------------------- -------------------------------------- --------------------------------------
38998 213 151
22624 26 38
0 1 0

#### Re: As two select under one from

Lilzen wrote:

stupid

``where&gt;&gt;&gt; mod &lt;&lt;&lt;(p1_10,&gt;&gt;&gt; 10 &lt;&lt;&lt;) in (4,5,7,&gt;&gt;&gt; 24 &lt;&lt;&lt;)``

#### Re: As two select under one from

If you so the figure of speech touched that it at you problems I simply I ask the help from knowing people in clarification of structure of a spelling of the thrown off code, on the customary... And a specific example

#### Re: As two select under one from

Elic wrote:

it is passed...

and concerning witty  mister Elic'... If you not in course that except -place numbers in the nature still  three-place

#### Re: As two select under one from

Lilzen wrote:

it is passed...
And concerning witty  mister Elic'... If you not in course that except -place numbers in the nature still  three-place

The good remark.
Riddle: how many will be?

``select mod (241,10) from dual;``

#### Re: As two select under one from

Lilzen wrote:

it is passed...
And concerning witty  mister Elic'... If you not in course that except -place numbers in the nature still  three-place

Under  )).....
It not the joke, is severe facts of life
Or you do not know that does mod (and use not that function) or something went not so

#### Re: As two select under one from

Lilzen wrote:

and concerning witty  mister Elic'... If you not in course that except  -place numbers in the nature still have     three -place

It is not necessary to stick out the dullness so moronically.

#### Re: As two select under one from

Lilzen wrote:

Children for stupid on an example please (((

``````select
sum (case when v_f10=1 and floor (p1_101/1000) not in (1,2) then 1 else 0 end) gr1;
sum (case when v_f10=2 and p11_25 in (54,55) or (p11_25 in (49,50) and rab2 in (54,55)) then 1 else 0 end) gr2;
sum (case when p11_25=42 or (p11_25 in (49,50) and rab2=42) then 1 else 0 end) gr3
from f117, (select level lvl from dual connect by level &lt;4) cnt
where mod (p1_10,10) in (4,5,7,24)
and ((lvl = 1)
or (lvl = 2 and p1_10 in (4,5))
or (lvl = 3 and d111 in (20,30,40,72,73,74,75,76,77)))
group by lvl``````

You excuse, I can not check up.
With mod... Pleased, I will leave the original code ))
And the answer with three-digit numbers... Well it is impossible so since morning, at people to scoff, they drink coffee, hang.

#### Re: As two select under one from

And if so

wrote:

102,124
mod (par, 10) in (2,24)

#### Re: As two select under one from

Lilzen wrote:

and if so
it is passed...

And the brain can nevertheless will include?

#### Re: As two select under one from

Lilzen;

``````SQL&gt; ed
Wrote file afiedt.buf
1 select count (sal) cc from emp e
2 union all
3* select count (comm) cc from emp e
4 /
CC
----------
14
3
SQL&gt; ed
Wrote file afiedt.buf
1 select count (decode (u, 1, sal, 2, comm)) cc
2 from emp e;
3 (select 1 u from dual union all select 2 from dual) d
4* group by u
SQL&gt; /
CC
----------
14
3``````

ps
Is  but I hope that  not important
....
stax