Hi All,
In our DB we have multiple tables say T1, T2 each have diff no. of columns T1 (A,B) and T2 (X,Y,Z) in each.
Each columns have 3 types of data 1,0 and any other number. I need the count of all 0,1 in all tables.
T1
-----
A B
0 1
1 0
0 x
1 1
T2
------
X Y Z
1 0 1
1 1 X
0 0 0
X X 1
1 1 1
Output should be
0 1
T1 A 2 2
T1 B 1 2
T2 X 1 3
T2 Y 2 2
T2 3 1 3
MOST important, each table will have millions of records and we have query the table only once.
If any more information please let me know.
Thanks,
Vijay