Hopefully this will make sense and there is a solution in a single query... if not, I'm sure i can do it using multiple queries.
I wrote a query that I thought would work, but didn't take into consideration that some of the records won't have data coming from one of the tables... That creates a problem, because it doesn't bring back any data for those records at all...
Here is my query
SELECT i.item_id, i.product_id, i.qty, i.price_each, bc.card_back, bc.full_name, p.product_name
FROM dealer_item AS i, dealer_product as p, BC_profile as bc
WHERE i.cart_id='2'
AND i.status='A'
AND p.product_id=i.product_id
AND i.profile_id=bc.profile_id
it is basically getting ALL items in a shopping cart...
The problem is that if the item happens to be Business Cards, there are a couple of pieces of data that need to come from the BC_profile table, and any other products ordered won't have any records in that table.
So, the question is... can a single query selectively get the two fields from the BC_profile table, based on the first 2 characters of the i.product_id being 'BC'?
Or is that asking a lot from the query?
Any feedback would be appreciated (preferably positive).
thanks in advance.
douglas