I'm trying to get company items using an SQL
statement which uses three tables and 1 WHERE
entry on a local XAMPP
server. I cannot figure out why I'm receiving null
entries. I have given the database details below. Thanks
SQL statement:
SELECT company_item.id, item_type, name, COUNT(item_demand.id_item), COUNT(item_sold.id_item)
FROM company_item
JOIN item_demand ON company_item.id = item_demand.id_item
JOIN item_sold ON company_item.id = item_sold.id_item
WHERE company_item.id_company="fhajdkadas";
OUTPUT:
TABLE: company_item:
for now it only contains 1 company item and all the values have been correctly entered, I have checked.
TABLE: item_demand:
for now this table does not have any record and I think it should not affect the SQL
statement.
TABLE: item_sold:
for now this table also does not have any record and I think it should not affect the SQL
statement.