
I need Someone to Combine 3 SQL Queries working Independently
- or -
Post a project like this370
£40(approx. $54)
- Posted:
- Proposals: 2
- Remote
- #4225534
- Awarded
Description
Experience Level: Entry
I have 3 different queries that are working, but I need to combine into one. If you have the skill to do this ASAP, please contact me and I will give you more information. see summary below please;
Query1: (combines 2 tables, select colums a,b,c from table 1, column d,e,f (date) from table 2, where column f is in the last two months (Apr & June data only), This produced about 200 rows data.
The plan is to join table 3 to the above, by adding few columns and maintaining all 200 rows in query 1, but t2ble 3 is a bit complex so its been split into 2.
Query 2: select columns g,h, & i from table 3 where coulmn i is NULL (we need to insert this column into query 1, keep all 200 rows, but some of the new rows inserted will be blank ).ids are all unique so easy to match
Once this is done, then we need to match the blank rows in columns g.h.i to query 3.
Query 3 is the opposite of query 2, but column i IS NOT NULL. Only problem is there are 3 columns in this that has multiple row, so we need to take max of these 3 column before matching to blank rows in the table above, so at the end we still have my 200 rows.
Finally, like to compare ids in Apr with those in May to see which ones are new. I hope this is clear, but please lets have a quick chat as it is easier to explain
Thanks,
Tinu
Query1: (combines 2 tables, select colums a,b,c from table 1, column d,e,f (date) from table 2, where column f is in the last two months (Apr & June data only), This produced about 200 rows data.
The plan is to join table 3 to the above, by adding few columns and maintaining all 200 rows in query 1, but t2ble 3 is a bit complex so its been split into 2.
Query 2: select columns g,h, & i from table 3 where coulmn i is NULL (we need to insert this column into query 1, keep all 200 rows, but some of the new rows inserted will be blank ).ids are all unique so easy to match
Once this is done, then we need to match the blank rows in columns g.h.i to query 3.
Query 3 is the opposite of query 2, but column i IS NOT NULL. Only problem is there are 3 columns in this that has multiple row, so we need to take max of these 3 column before matching to blank rows in the table above, so at the end we still have my 200 rows.
Finally, like to compare ids in Apr with those in May to see which ones are new. I hope this is clear, but please lets have a quick chat as it is easier to explain
Thanks,
Tinu
Ola F.
0% (0)Projects Completed
-
Freelancers worked with
-
Projects awarded
50%
Last project
25 Jul 2025
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies