Dave,
It's working as advertised. Count (expression) includes only the not null
values. If you want a record count you must use count (*).
HTH,
Luis
Sent from my Moto G phone. Please excuse my brevity.
On Mar 2, 2017 16:25, <dlclark@xxxxxxxxxxxxxxxx> wrote:
I have an SQL view which is a right join where the left table has
722 rows and the right table has 854 rows. I therefore expect 132 null
rows to represent the left table. Yet, when I run the following SQL
statement it only counts 722 rows. Why doesn't it count the 132 null
rows? And is there a way I can change this statement to count those rows
along with the other rows? Thanks.
Select LifoYn, count(LifoYn) as Count
from SHR460T.IMLFCMPV02
Group by LifoYn
Order by LifoYn;
LIFOYN COUNT
N 229
Y 493
- 0
------ -------
722
- 854
-------
132
Sincerely,
Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300
Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331
************************************************************
*********************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
************************************************************
*********************************
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.