![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I have the following query. *For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. |
|
I want 1 record per CUSTOMER_ID, regardless of the other values. |
|
* *SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, * * * * * DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type * *FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns * *WHERE co.order_id = ol.order_id * *AND ol.product_id = p.product_id * *AND p.code = ns.code * *AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) * *AND ol.status = 'Active' * *ORDER BY co.customer_id; Still working a solution. |
#3
| |||
| |||
|
|
Hi All, I have the following query. *For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. |
|
I want 1 record per CUSTOMER_ID, regardless of the other values. |
|
* *SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, * * * * * DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type * *FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns * *WHERE co.order_id = ol.order_id * *AND ol.product_id = p.product_id * *AND p.code = ns.code * *AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) * *AND ol.status = 'Active' * *ORDER BY co.customer_id; Still working a solution. |
#4
| |||
| |||
|
|
Hi All, I have the following query. *For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. |
|
I want 1 record per CUSTOMER_ID, regardless of the other values. |
|
* *SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, * * * * * DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type * *FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns * *WHERE co.order_id = ol.order_id * *AND ol.product_id = p.product_id * *AND p.code = ns.code * *AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) * *AND ol.status = 'Active' * *ORDER BY co.customer_id; Still working a solution. |
#5
| |||
| |||
|
|
Hi All, I have the following query. *For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. |
|
I want 1 record per CUSTOMER_ID, regardless of the other values. |
|
* *SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, * * * * * DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type * *FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns * *WHERE co.order_id = ol.order_id * *AND ol.product_id = p.product_id * *AND p.code = ns.code * *AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) * *AND ol.status = 'Active' * *ORDER BY co.customer_id; Still working a solution. |
#6
| |||
| |||
|
|
Hi All, I have the following query. For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. I want 1 record per CUSTOMER_ID, regardless of the other values. SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns WHERE co.order_id = ol.order_id AND ol.product_id = p.product_id AND p.code = ns.code AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) AND ol.status = 'Active' ORDER BY co.customer_id; Still working a solution. |
#7
| |||
| |||
|
|
Hi All, I have the following query. For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. I want 1 record per CUSTOMER_ID, regardless of the other values. SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns WHERE co.order_id = ol.order_id AND ol.product_id = p.product_id AND p.code = ns.code AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) AND ol.status = 'Active' ORDER BY co.customer_id; Still working a solution. |
#8
| |||
| |||
|
|
Hi All, I have the following query. For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. I want 1 record per CUSTOMER_ID, regardless of the other values. SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns WHERE co.order_id = ol.order_id AND ol.product_id = p.product_id AND p.code = ns.code AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) AND ol.status = 'Active' ORDER BY co.customer_id; Still working a solution. |
#9
| |||
| |||
|
|
Hi All, I have the following query. For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. I want 1 record per CUSTOMER_ID, regardless of the other values. SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns WHERE co.order_id = ol.order_id AND ol.product_id = p.product_id AND p.code = ns.code AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) AND ol.status = 'Active' ORDER BY co.customer_id; Still working a solution. |
#10
| |||
| |||
|
|
Hi All, I have the following query. For a few records, it returns duplicate CUSTOMER_ID's, though the rest of the record values are different. I want 1 record per CUSTOMER_ID, regardless of the other values. SELECT co.customer_id c_id, engine.calc_end_date (co.order_date, p.quantity, p.quantity_uom) end_date, DECODE(ns.subscr_type, 'Trial', 'Trial', 'Test', 'Trial', 'Paid') subscr_type FROM engine.customer_order co, engine.order_line ol, engine.product p, product.newsletter_subscription ns WHERE co.order_id = ol.order_id AND ol.product_id = p.product_id AND p.code = ns.code AND p.subproduct_id IN (197, 202, 209, 216, 220, 222) AND ol.status = 'Active' ORDER BY co.customer_id; Still working a solution. |
![]() |
| Thread Tools | |
| Display Modes | |
| |