Click here to Skip to main content
15,913,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Friends,

I want to take the count of group by

means i was displayed some values group by house no


I want the count of how much group of house no is displayed.


Please Help me........


Thanks in advance....
Posted

Try select count(house_no) from table group by house_no
 
Share this answer
 
Comments
basurajkumbhar 6-Nov-13 0:51am    
Thanks for response

Hi i have tried this it gives me group by it works well
SELECT Voter.*, temp100.YadiNo, temp100.CountHouseNo FROM temp100 INNER JOIN Voter ON (temp100.HouseNo = Voter.HouseNo) AND (temp100.YadiNo = Voter.YadiNo) WHERE (((temp100.YadiNo) Between " & txtpartno.Text.Trim & " And " & txtpartno1.Text.Trim & ") AND ((temp100.CountHouseNo) Between " & txtfamilymeb.Text.Trim & " And " & txtfamilymeb1.Text.Trim & "))order by voter.houseno;

I want to how much time group of house no is displayed.
ex

hose no
1
1
1
20
20
30
30
here is three group of house no
it
group of hose no
3
SQL
WITH TempCount(housecount,houseno)
AS
(
    select count(house_no),house_no from table group by house_no
)
SELECT houseno,count(housecount) from TEmpCount
 
Share this answer
 
You can put your resulted query in temp table like

select .....into #temp
from
....

group by....

after that use
select COUNT(distinct HouseNO.) from #temp

It will work for you
 
Share this answer
 
SELECT Distinct(voter.houseno) FROM temp100 INNER JOIN Voter ON (temp100.HouseNo = Voter.HouseNo) AND (temp100.YadiNo = Voter.YadiNo) WHERE (((temp100.YadiNo) Between " & txtpartno.Text.Trim & " And " & txtpartno1.Text.Trim & ") AND ((temp100.CountHouseNo) Between " & txtfamilymeb.Text.Trim & " And " & txtfamilymeb1.Text.Trim & "))order by voter.houseno;


thanks for all my friends....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900