Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simplify table
Message
From
12/04/2003 11:23:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00776946
Message ID:
00776952
Views:
14
This message has been marked as the solution to the initial question of the thread.
>How can I summarize a table like this
>
>
> USA
> USA
> USA
> USA
> BRAZIL
> BRAZIL
> BRAZIL
> UK
> UK
> UK
> UK
> UK
> CANADA
> CANADA
>
> ......Etc. Over 2000 names
>
>
> To a new summarized table
>
> USA
> BRAZIL
> UK
> CANADA
> ..........ETC
select distinct CountryName;
  from Countries;
  into table DistinctCountries
Or:
select CountryName, count(*) as HowOften;
  from Countries;
  group by CountryName;
  into table DistinctCountries
The second field (count(*)...), of course, is optional - you didn't ask for it, and you may want to omit that part.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform