Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Number of Rows in a SQL Table

Status
Not open for further replies.

lyric0n

Technical User
Dec 28, 2005
74
I have a table that looks like this...

127.0.0.1 192.168.1.1
127.0.0.2 192.168.1.1
127.0.0.3 192.168.1.2

Using distinct statements, I can get it so it looks like

192.168.1.1
192.168.1.2

Now I need a way that I can count how many rows are there...I've tried just adding the count(column) but it gives back errors and doesn't report what I want.

I appreciate the help.
 
Did you try putting the distinct values into a temp / separate table and then do count(*) or count(column)?
 
I've thought about that, but this will be accessed fairly often, and I'd rather not setup another table if there is a way to query the table.

Thanks
 
Worked like a charm, thank you much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top