select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `merchandise`.`merchandise_name`, `product`.`price` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` where `product`.`record_deleted` = 'n';

select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `merchandise`.`merchandise_name`, `product`.`price` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` where `product`.`record_deleted` = 'n' AND `product`.`product_type_name` = 'NORMAL' ORDER By `product`.`product_id`;

select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `product`.`external_code`, `merchandise`.`merchandise_name`, `product`.`price`, `product_attribute_link`.`retailer_prod_attrib_id`, `product_attribute_link`.`value`, `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_id`, `lu_retailer_prod_attributes_values`.`allowed_value` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` join `product_attribute_link` on `product`.`product_id` = `product_attribute_link`.`product_id` left join `lu_retailer_prod_attributes_values` on `product_attribute_link`.`retailer_prod_attrib_id` = `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_id` where `product`.`record_deleted` = 'n' AND `product`.`product_type_name` = 'NORMAL' AND `product_attribute_link`.`value` = 'id(5)' ORDER By `product`.`product_id`;

select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `product`.`external_code`, `merchandise`.`merchandise_name`, `product`.`price`, `product_attribute_link`.`retailer_prod_attrib_id`, `product_attribute_link`.`value`, `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_id`, `lu_retailer_prod_attributes_values`.`allowed_value` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` left join `product_attribute_link` on `product`.`product_id` = `product_attribute_link`.`product_id` left join `lu_retailer_prod_attributes_values` on `product_attribute_link`.`retailer_prod_attrib_id` = `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_values_id` where `product`.`record_deleted` = 'n' AND `product`.`product_type_name` = 'NORMAL' AND `product_attribute_link`.`value` = 'id(5)' ORDER By `product`.`product_id`;

select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `product`.`external_code`, `merchandise`.`merchandise_name`, `product`.`price`, `product_attribute_link`.`retailer_prod_attrib_id`, `product_attribute_link`.`value`, `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_id`, `lu_retailer_prod_attributes_values`.`allowed_value` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` left join `product_attribute_link` on `product`.`product_id` = `product_attribute_link`.`product_id` AND `product_attribute_link`.`value` = 'id(5)' left join `lu_retailer_prod_attributes_values` on `product_attribute_link`.`retailer_prod_attrib_id` = `lu_retailer_prod_attributes_values`.`retailer_prod_attrib_values_id` where `product`.`record_deleted` = 'n' AND `product`.`product_type_name` = 'NORMAL' ORDER By `product`.`product_id`;

select `product`.`product_id`, `product`.`merchandise_id`, `product`.`internal_code`, `product`.`external_code`, `merchandise`.`merchandise_name`, `product`.`price`, `product_attribute_link`.`retailer_prod_attrib_id`, `product_attribute_link`.`value` from `product` left join `merchandise` on `product`.`merchandise_id` = `merchandise`.`merchandise_id` left join `product_attribute_link` on `product`.`product_id` = `product_attribute_link`.`product_id` AND `product_attribute_link`.`retailer_prod_attrib_id` = '5' where `product`.`record_deleted` = 'n' AND `product`.`product_type_name` = 'NORMAL' ORDER By `product`.`product_id`;
