Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting and Identifying Values
Message
From
04/06/2001 12:29:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/06/2001 12:00:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00514598
Message ID:
00514652
Views:
8
>>
>>Edgar,
>>I'm not sure I understood it. Would you get something like :
>>
>>0 = 30+55...
>>1 = 24+10... ?
>>
>
>Cetin
>
>0-1 would be the column, namely Values, that would identify the values I'm counting. I don't have that. Therefore, I need a way to create that column so I can identify each COUNT.
>In other words, if I had only one column I need to count, I would do
>
>SELECT fld1 AS values,COUNT(Fld1) total FROM nTable
>that would show:
>0....39
>1....40
>2....55
>3....90
>4....29
>5....4
>
>but like I said, I have 30+ fields that I need to do this.
>Let me know if I didnt explained mayself again
>thanks Celtin

Could be w/o SQL ?
create cursor Counts (f1 i, f2 i, f3 i)
create cursor myCursor (f1 i, f2 i, f3 i)
for ix=1 to 20
  insert into myCursor values (int(rand()*6), int(rand()*6), int(rand()*6))
endfor
brow

dimension myArray[6,fcount()]
myArray=0

scan
 for ix=1 to fcount()
   myArray[eval(field(ix))+1,ix] = myArray[eval(field(ix))+1,ix]+1
 endfor
endscan
select Counts
append from array myArray
brow
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform