These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Select using CUBE/ROLLUP
PostPosted: Wed Oct 10, 2007 3:36 am 
Newbie

Joined: Tue Oct 09, 2007 2:33 am
Posts: 3
I have a branch offices all over india:

Chennai, Delhi, Calcutta and Mumbai. In each of these locations I have various employees with different designations like supervisor, manager , branch manager and boss.

Say employee table is like
id, name , city , designation

Assume (Only if required)Say all designations are stored in a table:
id, designation

I need to query employee table such that the result will be in the folloiwng format:

Chennai supervisor 5
Chennai manager 2
Chennai branch manager 1
Chennai boss 0

Calcutta supervisor 0
Calcutta manager 2
Calcutta branch manager 0
Calcutta boss 1

and so on...

I tried using CUBE but the I dont get the rows having ZERO as shown below:
Chennai supervisor 5
Chennai manager 2
Chennai branch manager 1

Calcutta manager 2
Calcutta boss 1


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.