1

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 ))

2

Re: As two select under one from

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

3

Re: As two select under one from

4

Re: As two select under one from

Foreheads in the first request asked two lines
And at you everywhere one smile

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 <3) tbl
GROUP BY ID

5

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

6

Re: As two select under one from

Lilzen wrote:

stupid

where>>> mod <<<(p1_10,>>> 10 <<<) in (4,5,7,>>> 24 <<<)

7

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

8

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

9

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;

10

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  smile)).....
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

11

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.

12

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 <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 smile))
And the answer with three-digit numbers... Well it is impossible so since morning, at people to scoff, they drink coffee, hang.

13

Re: As two select under one from

And if so

wrote:

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

14

Re: As two select under one from

Lilzen wrote:

and if so
it is passed...

And the brain can nevertheless will include?

15

Re: As two select under one from

Lilzen;

SQL> 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> 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> /
CC
----------
14
3

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