Following is my table structure with data
id orderNO lineItemNO orderStatus
1 100 1 Processing
2 100 2 Processing
3 100 3 Pending
4 101 1 Pending
5 101 2 Pending
i have orderNo and line item no column which represents the no of products in the order. Now i want only that orders and lineItemNo whose orderStatus is same.
for example
Order No with 100 has 3 line items (1,2,3) but line item no (1 and 2) has orderStatus as Processing ans line item no (3) has orderStatus has Pending so i dont want this order.
Now order No with 101 has 2 line items (1,2) and all line items from the same order has the same order status so i need order 101.
So looking for the SQL query for the same.
I need output as
id orderNO lineItemNO orderStatus
4 101 1 Pending
5 101 2 Pending
Please Help me