Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 city / state DB

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2004-11-24 : 17:00:23
Hi,

First off does anyone know where I can get a database of all major countries / states / cities? I am attempting to create a hierarchical display of this information. I'm guessing there is no free DB of this information out there so this brings me to help with my query.

I have a database of users in which I can essentially create my own structure for just USA and CAN. I want to run a query as such.

I pass it the STATEPROVID, and it returns ever city that is in the DB under that STATEPROVID. However I also want to return the count of each occurance. How can I do that ? I have simple table structure below.

Thanks a bunch

mike123



tblUserDetails

userID, stateProvID, city

1, 1, Anniston

tblStateProv

stateProvID, stateProv

1 / alabama



MichaelP
Jedi Yak

2489 Posts

Posted - 2004-11-24 : 17:08:52
It's not free, but I usually get such things from http://www.melissadata.com/

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2004-11-24 : 17:35:37
quote:
Originally posted by MichaelP

It's not free, but I usually get such things from http://www.melissadata.com/

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>



thanks Michael great link to have in my favourites! .. could have used this a few times in the past :)

I still think I need help on the query tho, anyone got any ideas

thanks again!
mike123
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2004-11-24 : 17:52:53
was confusing myself for some reaosn .... nevermind .. got it .. :)

mike123
Go to Top of Page
   

- Advertisement -