Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL display null results.
Message
From
26/04/2002 13:30:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00649673
Message ID:
00649715
Views:
7
>>Here's my query -
>>sele dist cellcode, count(cellcode)
>>from x where fdisp="01" group by cellcode. What I want this to do is show me ALL the distinct cellcodes along with the counts of FDISPs for each cellcode. If there are 0 fdisps, it needs to show me null or 0 for that cellcode
>
>Try
SELECT cellcode, count(*) ;
>  FROM mytable ;
>  WHERE fdisp="01" ;
>  GROUP BY 1
Actually, this will only give you cellcodes having at least one fdisp='01'; to do what he wants:
SELECT cellcode, SUM(iif(fdisp='01',1,0)) as fdispcount ;
  FROM mytable ;
  GROUP BY cellcode
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform