Welcome Guest, Not a member yet? Register   Sign In
LEFT JOIN for noobs
#1

[eluser]slowgary[/eluser]
Hi guys,

I have a query that left joins a few tables on the primary id, but when I get the results back the id field is duplicated (because it's in each table).

So my results look like this:
Code:
prod_id  |  prod_price  | prod_sku  |  prod_id  |  prod_image  |  prod_id  |  prod_stock

This works fine when all fields have data in them, but when the last table returns NULL as the prod_id, my code gets that one, which breaks everything.

Is there a way to only get back one prod_id field? Preferably from the first table. Thanks.


Messages In This Thread
LEFT JOIN for noobs - by El Forum - 06-15-2009, 08:36 AM
LEFT JOIN for noobs - by El Forum - 06-15-2009, 09:09 AM
LEFT JOIN for noobs - by El Forum - 06-15-2009, 09:27 AM
LEFT JOIN for noobs - by El Forum - 06-15-2009, 09:34 AM
LEFT JOIN for noobs - by El Forum - 06-15-2009, 10:51 AM
LEFT JOIN for noobs - by El Forum - 06-15-2009, 05:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB