Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Can i combine two query (first one excel second oracle) with left join?

What I have tried:

sql1="SELECT COL1 FROM ORACLETABLE "
sql2 ="SELECT COL1 FROM [REPORTSHEET$]"
SQL="SELECT * FROM ("& sql1 &") A LEFT JOIN ("& sql2 &") ON A.COL1=B.COL1"
Posted
Comments
CHill60 16-Sep-20 7:19am    
Not within the same session. You would have to get the oracle table into excel or the excel results into oracle to do it like that. An alternative is the CDS that Microsoft Power suite uses - e.g. Power BI or Power Query (in Excel) could join the two
Member 14588284 16-Sep-20 7:35am    
i can't write any data to Oracle table
CHill60 16-Sep-20 11:02am    
You need to use the "Reply" link next to a comment for the member to be notified of your response. If you cannot write data to the oracle database then you would need to download the data to the same excel workbook OR use the method I suggested. You cannot join database and excel in a single sql statement
Member 14588284 16-Sep-20 14:52pm    
ok
another alternative is acces mdb file ?
CHill60 17-Sep-20 8:29am    
Absolutely - you could download the data to Access and query it from there with such a join - or any other kind of local database. One word of warning - do not use a .mdb access file - the modern version is .accdb and the old format is going out of support very soon.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900