Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT A.product_id, A.product_code, A.product_name, A.create_datetime AS create_datetime_product, A.update_datetime AS update_datetime_product,
- A.active_datetime AS active_datetime_product, A.non_active_datetime AS non_active_datetime_product, A.active AS active_product,
- COALESCE(B.style_product, '') AS style, 'http://sdp-data.storage.googleapis.com/product_images/'||COALESCE(B.style_product, '')||'-1.jpg' AS style_image, COALESCE(B.size, '') size, COALESCE(B.color, '') color,
- COALESCE(B.flg_buy_konsinyasi, '') AS flag_consignment, COALESCE(B.create_datetime,'') AS create_datetime_product_custom, COALESCE(B.update_datetime, '') AS update_datetime_product_custom,
- COALESCE(B.active_datetime, '') AS active_datetime_product_custom, COALESCE(B.non_active_datetime, '') AS non_active_datetime_product_custom, COALESCE(B.active, '') AS active_product_custom,
- COALESCE(C.product_custom_field_id, -99) AS product_custom_field_id_gender, COALESCE(C.value, '') AS gender, COALESCE(C.create_datetime, '') AS create_datetime_product_custom_field_gender,
- COALESCE(C.update_datetime, '') AS update_datetime_product_custom_field_gender, COALESCE(C.active_datetime, '') AS active_datetime_product_custom_field_gender,
- COALESCE(C.non_active_datetime, '') AS non_active_datetime_product_custom_field_gender, COALESCE(C.active, '') AS active_product_custom_field_gender,
- COALESCE(D.product_custom_field_id, -99) AS product_custom_field_id_type, COALESCE(D.value, '') AS jenis, COALESCE(D.create_datetime, '') AS create_datetime_product_custom_field_type,
- COALESCE(D.update_datetime, '') AS update_datetime_product_custom_field_type, COALESCE(D.active_datetime, '') AS active_datetime_product_custom_field_type,
- COALESCE(D.non_active_datetime, '') AS non_active_datetime_product_custom_field_type, COALESCE(D.active, '') AS active_product_custom_field_type,
- A.ctgr_product_id, E.ctgr_product_code AS category_code, E.ctgr_product_name AS category_name, E.create_datetime AS create_datetime_category,
- E.update_datetime AS update_datetime_category, E.active_datetime AS active_datetime_category,
- E.non_active_datetime AS non_active_datetime_category, E.active AS active_category,
- A.sub_ctgr_product_id, F.sub_ctgr_product_code AS sub_category_code, F.sub_ctgr_product_name AS sub_category_name, F.create_datetime AS create_datetime_sub_category,
- F.update_datetime AS update_datetime_sub_category, F.active_datetime AS active_datetime_sub_category,
- F.non_active_datetime AS non_active_datetime_sub_category, F.active AS active_sub_category,
- A.brand_id, G.brand_code, G.brand_name, G.create_datetime AS create_datetime_brand,
- G.update_datetime AS update_datetime_brand, G.active_datetime AS active_datetime_brand,
- G.non_active_datetime AS non_active_datetime_brand, G.active AS active_brand,
- COALESCE(H.supplier_id, -99) AS supplier_id, COALESCE(H.supplier_product_code, '') AS supplier_product_code, COALESCE(H.create_datetime, '') AS create_datetime_supplier_info,
- COALESCE(H.update_datetime, '') AS update_datetime_supplier_info, COALESCE(H.active_datetime, '') AS active_datetime_supplier_info,
- COALESCE(H.non_active_datetime, '') AS non_active_datetime_supplier_info, COALESCE(H.active, '') AS active_supplier_info,
- COALESCE(I.partner_code, '') AS supplier_code, COALESCE(I.partner_name, '') AS supplier_name, COALESCE(I.create_datetime, '') AS create_datetime_supplier,
- COALESCE(I.update_datetime, '') AS update_datetime_supplier, COALESCE(I.active_datetime, '') AS active_datetime_supplier,
- COALESCE(I.non_active_datetime, '') AS non_active_datetime_supplier, COALESCE(I.active, '') AS active_supplier,
- COALESCE(J.weight, 0.0) AS weight, COALESCE(J.dimension_length, 0.0) AS length, COALESCE(J.dimension_width, 0.0) AS width, COALESCE(J.dimension_height, 0.0) AS height, COALESCE(J.create_datetime, '') AS create_datetime_dimension,
- COALESCE(J.update_datetime, '') AS update_datetime_dimension, COALESCE(J.active_datetime, '') AS active_datetime_dimension,
- COALESCE(J.non_active_datetime, '') AS non_active_datetime_dimension, COALESCE(J.active, '') AS active_dimension,
- COALESCE(K.product_vat_id, -99) AS product_vat_id, COALESCE(K.percentage, 0.0) AS product_vat, COALESCE(K.create_datetime, '') AS create_datetime_vat,
- COALESCE(K.update_datetime, '') AS update_datetime_vat, COALESCE(K.active_datetime, '') AS active_datetime_vat,
- COALESCE(K.non_active_datetime, '') AS non_active_datetime_vat, COALESCE(K.active, '') AS active_vat
- --SELECT COUNT (1)
- FROM m_product A
- INNER JOIN m_ctgr_product E ON A.ctgr_product_id = E.ctgr_product_id
- INNER JOIN m_sub_ctgr_product F ON A.sub_ctgr_product_id = F.sub_ctgr_product_id
- INNER JOIN m_brand G ON A.brand_id = G.brand_id
- LEFT JOIN m_product_custom B ON A.product_id = B.product_id
- LEFT JOIN m_product_custom_field C ON A.product_id = C.product_id AND A.tenant_id = C.tenant_id AND C.product_attr_code = 'GENDER'
- LEFT JOIN m_product_custom_field D ON A.product_id = D.product_id AND A.tenant_id = D.tenant_id AND D.product_attr_code = 'TYPE'
- LEFT JOIN m_product_consignment_supp_info H ON A.product_id = H.product_id
- LEFT JOIN m_partner I ON H.supplier_id = I.partner_id
- LEFT JOIN m_product_weight_dimension J ON A.product_id = J.product_id
- LEFT JOIN m_product_vat K ON A.product_id = K.product_id
Add Comment
Please, Sign In to add comment