0

example:

date_entry  time_start  time_finished idle_code
8/8/2013    8:00        9:00             0
8/8/2013    9:01        10:00            1
8/8/2013    11:01       12:00            2 
8/8/2013    12:01       13:00            3
8/8/2013    13:01       14:00            4
8/8/2013    14:01       15:00            5
8/8/2013    16:01       17:00            6
8/8/2013    17:01       18:00            7

how can i combine/group the idle_code '0' and 6 then the other group idle_code '1','2','3','4','5','7'

i only need to groups group A = '0', '6' and group B = '1','2','3','4','5','7'

Nenad Zivkovic
  • 18,221
  • 6
  • 42
  • 55
cavin
  • 1
  • 2

1 Answers1

0

You may try grouping by by case, something like this:

  select ...
    from ...
   where ...
group by case 
           when (idle_code in ('0', '6')) then
             'A'
           else
             'B'
         end

P.S. I don't have PowerBuilder, so I've checked it on Oracle

Dmitry Bychenko
  • 180,369
  • 20
  • 160
  • 215