View Single Post
  #5 (permalink)  
Old 02-09-10, 12:52
jpcaissy jpcaissy is offline
Registered User
 
Join Date: Feb 2010
Posts: 3
Quote:
Originally Posted by r937 View Post
please note you gave inventaire twice, and forgot to include boutique
Oops right. Here it is :
Code:
--
-- Table structure for table `boutique`
--

CREATE TABLE IF NOT EXISTS `boutique` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(32) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `boutique`
--

INSERT INTO `boutique` (`id`, `name`) VALUES
(1, 'Lévis'),
(2, 'Montréal');
The query I have so far :
Code:
SELECT concat(product.code, product_option.code) as code, concat_ws(\" - \", product.name, product_option.name) as article,
product_option.price as prix, product_option.cout as cout, inventaire.entrepot as entrepot, inventaire.limite as limite,
inventaire.qte_commande as qte_a_commande, inventaire.qte_deja_commande as qte_deja_commande, inventaire.entrepot * product_option.cout as cout_total
FROM product_option, product, inventaire
WHERE
product_option.product_id = product.id
AND inventaire.product_option_id = product_option.id
What I can't get done is to get the quantities for both boutiques (Lévis & Montréal) from inventaire_boutique from within this query. I just have no clue on how to accomplish that.
Reply With Quote