Hi folks,
I have two table, the first one name is basetab1 and the second is basetab2, as the following:
Table1:
select usertype Brands, count(*) Subscriber from basetab1
group by usertype
order by usertype
brands subscriber
--------- -------------
0 29029
1 2
2 21
3 175
4 467
Table2
select subtype ,subtypename from basetab2
isdntype isdntypename
----------- ----------------------------
0 Default
1 Employee
2 Test
3 Test2
4 Private
Question is, how can I get such result in one query:
isdntypename Subscriber
----------- -------------
Default 29029
Employee 2
Test 21
Test2 175
Private 467
I've tried these syntaxes but I've filed to get a quesry
First Syntax:
select isdntypename, count(*) MSISDN
for basetab1.usertype=basetab2.isdntypename
group by usertype
Second Syntax:
select isdntypename, count(msisdn) MSISDN
for basetab1 inner join basetab2 on (basetab1.usertype=basetab2.isdntypename)
group by usertype
Your HELP please!