Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select
Message
From
08/05/1998 10:51:33
Alex Zhadanov
Computer Generated Solutions
New York City, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00098004
Message ID:
00098082
Views:
25
>If I have a table that has 20 records in it, and the first 10 store the number 1 and the second 10 store the number 2 in it. Is there any way to use the SQL Select statement to count the number of occurences of 10 and 20 in one statemnet? Or do I have to use a calculate cnt() statement twice, once for 10 and once for 20.
>
>Thanks,
>Matt
You can use this :
select sum(iif(number = 1,1,0)) AS num1,SUM(IIF(number=2,1,0)) AS num2 FROM AA into cursor result
cursor result will have 1 row and 2 columns. Column 1 is number of records with
1 and column 2 is number of records with 2

ALEX
Previous
Reply
Map
View

Click here to load this message in the networking platform