-
Query Help Please
I have a table defining the delivery route of vehicles to customers. But some entries have been corrupted.
Here is a simplified version of the table
Customer |
Product |
DropOrder |
CusA |
Prod1 |
1 |
CusA |
Prod2 |
1 |
CusB |
Prod1 |
2 |
CusB |
Prod3 |
2 |
CusB |
Prod5 |
4 |
CusC |
Prod1 |
3 |
CusC |
Prod6 |
3
|
Prod5 for CusB has got a Drop order of 4 but CusB's other products have got a DropOrder of 2 - which could end up with extra mileage / delay etc
I am trying to construct a query to spot those customers who have different DropOrders for their set of products (and failing)
Can anyone suggest a suitable bit of SQL?
many thanks
Geoff
-
Group by Cust and DropOrder.
That will show you the differences. Could also add a count of Prod to see which way you should alter the data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules