|  | Posted by dn.perl@gmail.com on 02/16/07 08:10 
I have a table t1 with two columns : c11 varchar(32) , c22 varchar(32)
 The data in the table is :
 '11', 'aa01'
 and on upto
 '11', 'aa50'   : total 50 entries
 '22', 'b01'
 '22', b'02'
 '22', b'03'
 '33', 'c01'  to  '33', 'c40' : total 40 entries
 '44', 'b02'
 '44', 'd01'
 '44', 'd01'
 '44', 'd01'
 
 
 How can write a query which will bunch together values of c11
 with rows > 5, and then bunch together values of c11 with
 rows < 6, and add them up.
 My output should be :
 '11'     50
 '33'     40
 'others'   7     (3 rows for '22' and 4 for '44' are bunched
 together
 as the # of rows < 6, and added. 3+4 = 7)
 [Back to original message] |