home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!cbnewse!cbnewsd!att-out!pacbell.com!rtech!ingres!jonm
- From: jonm@Ingres.COM (Don't Judge a book by your cover)
- Subject: Re: Counting Null Values in an SQL Query
- Message-ID: <1993Jan21.092811.13704@pony.Ingres.COM>
- Summary:
- News-Software: VAX/VMS VNEWS 1.41
- Keywords: I am a Beginner
- Organization: University of Arizona MIS Department - Mosaic Group
- References: <1993Jan20.233912.13272@mnemosyne.cs.du.edu>
- Date: 21 Jan 93 09:28:11 GMT
- Lines: 31
-
- In article <1993Jan20.233912.13272@mnemosyne.cs.du.edu>, afadel@nyx.cs.du.edu (Ayman Fadel) writes...
- >
- >The problem is I'm also supposed to count the
- >number of patients in each unit form whom no
- >value of acuity was entered, ie. level is null.
- >
- >This is what i got
- >
- >select station,
- > level,
- > count(level)
- >from ag_medical //the name of the table
- >where in_house='YES'
- >group by station, level
- >order by station, level
- >
- >Everything is good except that I cannot get a count for the
- >number of patients without an acuity.
-
- That is because aggregates ignore NULLS. If you do count(*) it should work.
-
- Jon
-
- +---------------------------------------------------------------------------+
- |Jon Machtynger (jonm@ingres.com) |
- |Ingres Technology Centre. Wharfedale Rd, |
- |Winnersh, Wokingham. Berks UK. (0734)-496525 |
- +---------------------------------------------------------------------------+
- | Ahhh Brisbane, people actually get paid to work there... in the sun with |
- | all that fresh air and cheap petrol.... Or so legend has it |
- +---------------------------------------------------------------------------+
-