Guest User

Untitled

a guest
Jan 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. (select products.*, sum(100000) as count1, product_sku.price AS sku_price, product_sku.label AS sku_label from `products` left join `product_sku` on `products`.`id` = product_sku.product_id AND product_sku.is_primary = "Yes" AND products.is_variation = "Yes" where `product_name` = "testproduct1" and `status` = "Active" and exists (select * from `campaign` where `products`.`exclusive_for` = `campaign`.`id` and `status` = "Published" and `active_inactive` = "Active" or `products`.`exclusive_for` is null) group by `products`.`id` having id != 0)
  2.  
  3. union
  4.  
  5. (select products.*, ROUND ( (LENGTH(products.product_name)- LENGTH( REPLACE ( products.product_name, "testproduct1", "") ) ) / LENGTH("testproduct1") ) AS count1, product_sku.price AS sku_price, product_sku.label AS sku_label from `products` left join `product_sku` on `products`.`id` = product_sku.product_id AND product_sku.is_primary = "Yes" AND products.is_variation = "Yes" where (`products`.`product_name` LIKE "%testproduct1%" or `products`.`description` LIKE "%testproduct1%") and `status` = "Active" and exists (select * from `campaign` where `products`.`exclusive_for` = `campaign`.`id` and `status` = "Published" and `active_inactive` = "Active" or `products`.`exclusive_for` is null) having id != 0 )
  6. group by `p_id`
Add Comment
Please, Sign In to add comment