Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How to get list of suppliers having only open orders? My sample data is as below:

SuppierID, orderID, orderStatus,orderdate
1,11,open,12/28/2020
1,22,open,12/27/2020
2,33,open,12/26/2020
2,44,closed,12/27/2020
3,55,closed,12/26/2020

Expected output is:

1,12/28/2020

Tried with groupby and having in query record processor but having clause not supported by Nifi it seems


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
778 views
Welcome To Ask or Share your Answers For Others

1 Answer

You could try something like

SELECT DISTINCT T.SupplierID FROM YourTable AS T WHERE NOT EXISTS ( SELECT 1 FROM YourTable AS X WHERE T.SupplierID=X.SupplierID AND X.orderStatus='closed' )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...