Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A list of customers with only one order 1

Status
Not open for further replies.

iren

Technical User
Mar 8, 2005
106
0
0
US
I have a list of customers with member_num and date when their order was submitted.
Most of them made more than one order. However I need to isolate those of them who made an only one order.
Could you, please, give me a hand? Thank you in advance,

Iren
 
If your data is in a SAS dataset (you could also do something similar on a database or if you have a counter for orders you could also sum that variable):

Code:
PROC SQL;
     CREATE TABLE EXTRACT.ONE_ORDER   AS
     (SELECT
 A.CUSTOMER
,A.MEMBER_NUM
,COUNT(A.MEMBER_NUM) AS MEMBER_COUNT

     FROM EXTRACT.ORDERS        as A
     
GROUP BY 1,2

HAVING MEMBER_COUNT < 2

     );
QUIT;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top