oracle - SQL and Grouping -


lost in sql on grouping. have table looks this:

start stop source 1     1    2     2    3     3    b 4     4    b 5     5    b 

and need group this:

start stop source 1     2    3     5    b 

the minimum number in start maximum number in stop each source.

thanks, mike

you need add min() , max() aggregate group by:

select   min(start) start,          max(stop)  stop,          source     yourtable group source 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -