Hello everyone:
I have a query that works well, but I'm trying to see if I can clean up my results a little bit.
The query pulls the State
and Fiber ID
fields from my table called fiber_intake
. It then pulls all fields from my hvi
table where the Fiber ID = GA in the fiber_intake table.
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 it pulls all the GA Fiber ID's, even the one's without hvi data in the other table. So I get some results with a bunch of Nulls for the hvi data.
Is there a way to exclude the Fiber ID's that do not have hvi table data associated with them?
Thanks!