I need help from a professional with good SQL knowledge.
I need to get some optimized SQL queries to run on a large database. (10+ million rows)
The first query I need help with needs to be run on attached screenshoted tables.
There are multiple instances of sets of data in the operation table, each set with a unique importRef_id
ie for workorder:
id,workorder,name
1, 1, "something"
2, 2, "something else"
and for operation:
id,workorder,operation,ImportRef_ID,delay:
1, 1, 1, 1, 0
2, 1, 2, 1, 10
3, 1, 3, 1, -5
4, 1, 1, 2, 2
5, 1, 2, 2, 2
6, 1, 3, 2, 0
7, 2, ...
I want for each workorder to know:
1. for the lowest importRef_id for each workorder (ie first 3 rows in sample) what is the delay of the highest operation (should be -5)
2. for the lowest importRef_id for each workorder (ie first 3 rows in sample) what is the highest delay of all the operations (should be 10)
3. for the highest importRef_id for each workorder (ie last 3 rows in sample) what is the delay of the highest operation (should be 0)
4. for the highest importRef_id for each workorder (ie last 3 rows in sample) what is the highest delay of all the operations (should be 2)
need to run a query to get something like:
id, workorder, first_final, first_total, last_final, last_total
1, 1, -5, 10, 0, 2
2, 2, ...
I pay per hour, but I expect this to be <=1 hour. There will be more work later if you are good.
Please have a look at my profile. I have expertise in SQL.
Here are some of my work examples.
Project Report Automation -
[login to view URL]
Log Report Automation -
[login to view URL]
Web Scarping -
[login to view URL]
I have also provide link of my linkedin profile.
[login to view URL]
I have worked extensively on Perl, C++, C, PL/SQL, excel formula, vba, access and Java. Even there are recommendation from my clients for my work on linkedin.
Please share your requirement in detail.
Be assured that your work will get completed on time and quality.
Hoping to hear back soon.
Warm Regards,
Rajeev Kumar