SELECT i.c.w. a COUNT and INNER JOIN gives different results with string literals and numeric values when they are used in a WHERE clause I have a MySQL query: 

SELECT 
    p.informationProvider as pGLN,
    p.productID,
    p.productStatus
FROM tblproducts AS p
WHERE 
     -- informationProvider is of type varchar(14)
    p.informationProvider = '8718885110005'


Result of that is:

pGLN            productID productStatus
8718885110005   497905    closed
8718885110005   497906    closed
8718885110005   497907    closed
8718885110005   497908    closed
8718885110005   505972    closed
8718885110005   505973    closed
8718885110005   508261    received
8718885110005   508262    received
8718885110005   508263    received
8718885110005   513591    received
8718885110005   517529    received
8718885110005   537381    received


Now I have another query: 

SELECT 
    c.informationProvider as cGLN,
    c.companyName
FROM tblcompanies as c
WHERE 
    -- informationProvider is of type varchar(14)
    c.informationProvider = 8718885110005


The Result of that is:

cGLN            companyName
8718885110005   Oliva BV


Now I'll combine those two queries. 

SELECT 
    c.informationProvider as cGLN,
    p.informationProvider as pGLN,
    COUNT(p.productID) AS count,
    p.productID,
    p.productStatus 
FROM tblproducts AS p 
INNER JOIN tblcompanies AS c ON (c.informationProvider = p.informationProvider) 
WHERE       p.productStatus IN ('requested' , 'expected', 'open')  -- closed and received aren't in the list    
AND c.informationProvider = '8718885110005'


The result: 

cGLN           pGLN count productID productStatus
8718885110005  NULL  0     NULL      NULL


-------- the problem ------

Ok, now I'll change a little. 
I'll change AND c.informationProvider = '8718885110005' to AND c.informationProvider = 8718885110005. Thus, the string will be presented as an integer.

The result of that is:

cGLN           pGLN count productID productStatus
NULL           NULL  0     NULL      NULL


This surprised me, why does the cGLN cell have a NULL? 

My first idea was to check if the string value is equal to the integer. To my surprise they were.

SELECT 8718885110005 = '8718885110005'; -- this is 1


This surprised me even more.

My question: 
Why is the cGLN NULL?
The commenters were very helpful. They pushed me into thinking in the right direction. Let me explain. 

If you would have a table like this: 

gln     status
108     closed
108     open
108     closed


And, you would execute a query like this: 

SELECT COUNT(gln) FROM tableA


The result would be 3. 

If you would execute a query like below: 

SELECT COUNT(gln), status FROM tableA


Then you would only see 1 status, others status cells would disappear. 
This disappearance could mean trouble.  

A correct query should look like this: 

SELECT COUNT(gln), status FROM tableA GROUP BY status




ONLY_FULL_GROUP_BY

MySQL can work in different modes. One of these mode is called: ONLY_FULL_GROUP_BY. This mode is turned off on some Database Servers.
This mode forces Database Administrators to use the GROUP BY in an aggregated query ( query with a COUNT() ). 

Link: https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_only_full_group_by



@danblack was thinking in the right direction. 
The query should look like this: 

SELECT 
    c.informationProvider as cGLN,
    p.informationProvider as pGLN,
    COUNT(p.productID) AS count,
    p.productID,
    p.productStatus 
FROM tblproducts AS p 
INNER JOIN tblcompanies AS c ON (c.informationProvider = p.informationProvider) 
WHERE       p.productStatus IN ('requested' , 'expected', 'open')
AND c.informationProvider = '8718885110005'
GROUP BY p.productID, p.productStatus, p.informationProvider