BrazilMac Posted October 7, 2008 Share Posted October 7, 2008 Hello, Im trying to use a LEFT Join on 2 tables: One is Affiliate Feed and the other is Price Feed. AffiliateFeed contains a list of items for sale. the id for each product is stored in the ID column. Mind that there is no Primary Key on this table since this table is imported from a feed daily to mysql server so. The PriceFeed table contains 3 fields: EVENT_ID, MAXIMUM and MINIMUM. These are used to store the id of the product, its highest and lower price. This table also does not have a primary key. This is the query Im using: SELECT * FROM AffiliateFeed LEFT JOIN PriceFeed ON AffiliateFeed.ID = PriceFeed.EVENT_ID WHERE GENREGRANDPARENT = 'DELL COMPUTERS' The query returns all fields from AffiliateFeed and its data, but for the 3 fields from PriceFeed, EVENT_ID, MAXIMUM and MINIMUM showed as NULL (Im using PHPAdmin for this query). All data for these rows are NULL. What can I do to fix??? Quote Link to comment https://forums.phpfreaks.com/topic/127401-help-with-left-join-returning-null-for-results-of-one-table/ Share on other sites More sharing options...
fenway Posted October 7, 2008 Share Posted October 7, 2008 They're null because there is not matching event_id in this table... that's what you asked it to do. Quote Link to comment https://forums.phpfreaks.com/topic/127401-help-with-left-join-returning-null-for-results-of-one-table/#findComment-659120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.