Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle SQL statement question
A copy of this was sent to "Mike" <mmilli_at_priment.com>
(if that email address didn't require changing)
On Thu, 3 Sep 1998 07:24:33 -0700, you wrote:
>OK, I'm glad I found this group -
>
>I'm developing a VB5 application with an Oracle 7.x backend (Which will be
>converted to 8 this weekend ) I am VERY new to Oracle, a total newbie, this
>project was placed in my lap mid-stream.
>
>I need some assistance in converting this MS Access SQL statement to a
>format that Oracle will understand. I keep getting an ODBC error message
>saying I'm missing the Select keyword - since I'm not missing it I need to
>know what I am doing wrong.
>
>Thanks in advance for any assistance or advice to point me in the right
>direction:
>
>Three tables being accessed are loans_yesterday, repo and warranty:
>
>SELECT loans_yesterday.key, loans_yesterday.customer_name,
>loans_yesterday.note_date, warranty.warr_contract_amount,
>warranty.repo_mileage, warranty.warr_month_term, warranty.warr_mileage_term,
>warranty.original_loan_mileage, repo.repo_date, warranty.warr_file_amt
>FROM (loans_yesterday inner join warranty on loans_yesterday.key =
>warranty.key) inner join repo on (warranty.key_seq = repo.key_seq) and
>(loans_yesterday.key = repo.key)
>WHERE (((loans_yesterday.note_date) is not null) and
>((warranty.warr_contract_amount) is not null) and ((warranty.repo_mileage)
>is not null) and ((warranty.warr_month_term) is not null) and
>((warranty.warr_mileage_term) is not null) and
>((warranty.original_loan_mileage) is not null) and ((repo.repo_date) is not
>null) and ((warranty.warr_file_amt) is null))
>
the problem is the syntax "inner join" -- thats not valid in Oracle.
The query could be:
SELECT loans_yesterday.key, loans_yesterday.customer_name,
loans_yesterday.note_date, warranty.warr_contract_amount, warranty.repo_mileage, warranty.warr_month_term, warranty.warr_mileage_term, warranty.original_loan_mileage, repo.repo_date, warranty.warr_file_amtfrom loans_yesterday, warranty, repo
warranty.key_seq = repo.key_seq and loans_yesterday.key = repo.key )AND
that is, you'll move the join conditions from the FROM clause to the where clause.
>Mike Milliron
>mmilli_at_primenet.com
>mikem_at_msamail.com
>
>
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Sep 03 1998 - 09:30:29 CDT
![]() |
![]() |