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
|