richrock Posted November 20, 2008 Share Posted November 20, 2008 Hi all, I'm trying to retrieve information in a single mysql command to generate information for a pdf file. This requires a total list of items in a sale, and also displayed alongside will be offers made prior the sale. I have two tables, one has around 200 items, called bid_auctions, and the other called bids. bid_auctions has an entry called bid_offer, and simply indicates 0 or 1, depending on whether the item has (1) or hasn't (0) had a bid placed on it. the second table (bids) has information such as bid_amount, bid_id (the id number from bid_auctions). I need to list all items, and if they have a bid, list that info too. I can't seem to find any info about joining where there is an 'if' statement, eg join bids if bid.id_offer = bid_auctions.id.... Help Update: I've found that I can do if in mysql, however, can't figure out how to do an if.. join statement... Quote Link to comment https://forums.phpfreaks.com/topic/133471-join-with-incomplete-data-problem/ Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 for that, you would need a full outer join. but, i went to go look up the syntax for mysql and it seems it doesn't support full outer joins. another google search turned up this tutorial on how to 'simulate' it though. Hope it helps: http://www.xaprb.com/blog/2006/05/26/how-to-write-full-outer-join-in-mysql/ Quote Link to comment https://forums.phpfreaks.com/topic/133471-join-with-incomplete-data-problem/#findComment-694311 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.