Home > database >  The grammar of the Oracle for grouping data query no repeat
The grammar of the Oracle for grouping data query no repeat

Time:10-13

Table has A, B, C three types, asked to take out the only appeared in the morning, the type and amount of which is to draw A 2 as A result, the demand for any good ways for

CodePudding user response:

What do you mean,
Select * from tab_name where level='morning';
Like this?
Don't repeat refers to what data don't repeat?

CodePudding user response:

 select a. * 
The from tab_name a
Where a. level='morning'
And a. type not in (select type from tab_name where level & lt;> 'morning')

CodePudding user response:

 
Select * from (
Select a t1. *, count (decode (t1) type, 'zaoshang, null, 1)) over (partition by t1. B) cn from tab1 t1
) t1 where t1. Cn=0


  • Related