Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Convert MS-Access 2 joined queries to Oracle SQL?
If you want to work in Oracle you must learn Oracle. You can not just
throw Microsoft's version of SQL at it and expect it to work.
The "INNER JOIN" syntax was not added to Oracle until version 9i. In Oracle the syntax for joining is to join in the WHERE clause. For example:
SELECT a.field1, b.field2
FROM table1 a, table2 b
WHERE a.field1 = b.field7;
Daniel Morgan
April wrote:
> How can I rewrite the following MS-Access queries for Oracle 7.3 sql?
> I don't know how to join the two queries?
>
> This is the query that joins the 2 saved queries, and is the end
> result that I want:
>
> SELECT qry_PEContact.EMPLOYEENAME AS PEContact, qry_Managers.GROUPDATA
> AS Manager
> FROM qry_Managers INNER JOIN qry_PEContact ON qry_Managers.DEPTID =
> qry_PEContact.EMPLOYEEDEPTID;
>
> Here is qry_PEContact:
> SELECT TBLEMPLOYEES.EMPLOYEENAME, TBLEMPLOYEES.EMPLOYEEDEPTID
> FROM TBLEMPLOYEES;
>
> Here is qry_Managers:
> SELECT TBLCBOCOMBO.GROUPDATA, TBLDEPARTMENTS.DEPTID
> FROM (TBLDEPARTMENTS INNER JOIN TBLEMPLOYEES ON TBLDEPARTMENTS.DEPTID
> = TBLEMPLOYEES.EMPLOYEEDEPTID) INNER JOIN TBLCBOCOMBO ON
> TBLEMPLOYEES.EMPLOYEENAME = TBLCBOCOMBO.GROUPDATA
> WHERE (((TBLCBOCOMBO.DIVISION)="NM") AND
> ((TBLEMPLOYEES.APPROVINGAUTHORITY)="True") AND
> ((TBLCBOCOMBO.GROUPTYPE)="NMContractMgr"));
>
> Thanks for your help,
> April
Received on Wed Apr 10 2002 - 09:59:29 CDT