I have problem with SQL query as it returns multiple rows, I am looking to get values only from
ps_tax t
any one can help me?
SELECT bgc.id_product,bgc.id_order, tx.id_tax_rules_group,t.id_tax,pl.name,t.rate as rate, brl.price as gift_price
FROM ps_bestkit_gift_cart bgc
LEFT JOIN ps_bestkit_gift_rule brl ON brl.id_bestkit_gift_rule = bgc.id_bestkit_gift_rule
LEFT JOIN ps_product_lang pl ON bgc.id_product = pl.id_product
LEFT JOIN ps_product p ON pl.id_product = p.id_product
LEFT JOIN ps_tax_rule tx ON p.id_tax_rules_group = tx.id_tax_rules_group
LEFT JOIN ps_tax t ON tx.id_tax = t.id_tax
WHERE id_order =8452
AND pl.id_lang=3
AND tx.id_country=6
There is a screenshot of my result
The DDL
CREATE TABLE ps_bestkit_gift_rule (
id_bestkit_gift_rule int(11) unsigned NOT NULL AUTO_INCREMENT,
is_product_depends tinyint(1) unsigned DEFAULT NULL,
is_supplier_depends tinyint(1) unsigned DEFAULT NULL,
is_manufacturer_depends tinyint(1) unsigned DEFAULT NULL,
is_category_depends tinyint(1) unsigned DEFAULT NULL,
is_attribute_depends tinyint(1) unsigned DEFAULT NULL,
is_feature_depends tinyint(1) unsigned DEFAULT NULL,
is_allow_other_gift tinyint(1) unsigned DEFAULT NULL,
cart_amount decimal(17,2) unsigned NOT NULL,
max_cart_amount decimal(17,2) unsigned NOT NULL,
price decimal(17,2) unsigned NOT NULL,
min_qty_inside_category int(10) unsigned NOT NULL DEFAULT 0,
min_price_inside_category decimal(17,2) unsigned NOT NULL,
from_date date NOT NULL,
to_date date NOT NULL,
criteria_order_type varchar(32) NOT NULL,
criteria_max_per_customer int(11) unsigned NOT NULL,
criteria_nb_products int(11) unsigned NOT NULL,
gift_preselector_product_page tinyint(1) unsigned DEFAULT NULL,
available_gifts int(10) unsigned NOT NULL DEFAULT 1,
criteria_coupon text,
criteria_customer_group text,
message tinyint(1) unsigned DEFAULT NULL,
active tinyint(1) unsigned DEFAULT NULL,
position int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (id_bestkit_gift_rule)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8