SELECT DISTINCT (`product`.`relative`) AS `relative`,
`product`.`users_sid` AS `users_sid`,
`product`.`global_branch_office_id` AS `global_branch_office_id`,
`product`.`fullname` AS `fullname`,
`product`.`description` AS `description`,
`product`.`code` AS `code`,
`product`.`category_id` AS `category_id`,
`product`.`subcategory_id` AS `subcategory_id`,
`product`.`brand_id` AS `brand_id`,
`product`.`barcode` AS `barcode`,
`product`.`enabled` AS `enabled`,
`product`.`status` AS `status`,
`product`.`created_at` AS `created_at`,
`product`.`updated_at` AS `updated_at`,
`price`.`price` AS `price`,
`price`.`currency_id` AS `currency_id`,
`currency`.`code` AS `currency`,
`category`.`label` AS `category`,
`stock`.`quantity` AS `quantity`,
`stock`.`measurement_id` AS `measurement_id`,
`measurement`.`label` AS `measurement`
FROM `core_sivir`.`sivir_products` AS `product`
,`core_sivir`.`sivir_products_price` AS `price`
,`core_sivir`.`core_sivir_currency` AS `currency`
,`core_sivir`.`sivir_catalog_category` AS `category`
,`core_sivir`.`sivir_products_stock` AS `stock`
,`core_sivir`.`sivir_catalog_measurement` AS `measurement`
WHERE
(`product`.`relative` = `price`.`product_id`)
AND (`product`.`relative` = `stock`.`product_id`)
AND (`price`.`currency_id` = `currency`.`id`)
AND (`product`.`category_id` = `category`.`value`)
AND (`product`.`global_branch_office_id` = `category`.`global_branch_office_id`)
AND (`stock`.`measurement_id` = `measurement`.`value`)
AND (`product`.`global_branch_office_id` = `measurement`.`global_branch_office_id`)
