I have a query that works well, but I'm trying to check if I can clean my results a bit.
The query pulls the fields to Stateand Fiber IDfrom my table with the name fiber_intake. Then it retrieves all the fields from the table hvi, where Fiber ID = GA in the fiber_intake table.
the code:
SELECT `fiber_intake`.`State`, `fiber_intake`.`Fiber ID`, `hvi`.*
FROM `fiber_intake`
LEFT JOIN `hvi` ON `fiber_intake`.`Fiber ID` = `hvi`.`Fiber ID`
WHERE (`fiber_intake`.`State` = 'GA')
It works great, except that it pulls all GA Fiber identifiers, even those that don't have hvi data in another table. So I get some results with a bunch of Nulls for hvi data.
Is there a way to exclude a Fiber id that is not related to the hvi table data?
Thank!
source
share