I have sales orders with quotes against them however new quote revisions are made and sometimes the sales orders don't get updated. So i need to write query to find any orders that don't have the most updated quote.
Currently this is done in excel but i want to be able to run a query to get the same results.
MY SQL or SQL Server.
Table and fields
Sales order lines
- sales order ID / current quote ID
Quotes
- Quote ID
The sales order ID is a numerical field XXXXX.
The quote ID fields are like 12345 and if a new revision is created it a new quote is added and called 12345-A it goes up alphabetically per revision.
What i want to see is
Sales order ID | Current Quote ID | Latest Quote ID
---------------|------------------|-----------------
53849 | 12345 | 12345-D
Please let me know if this is possible
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…