Home » SQL & PL/SQL » SQL & PL/SQL » OUTERJOIN (9I)
OUTERJOIN [message #323243] Tue, 27 May 2008 21:47 Go to next message
jaly
Messages: 1
Registered: May 2008
Junior Member
WHY THIS ERROR IN THE FOLLOWING QUERY

Invalid Query String !
Error number: -2147217 Description: ORA-00923: FROM keyword not found where expected
Error number: -2147217900
Description: One or more errors occurred during processing of command.
QUERY IS :-

>> select b.co_name as agent_name, a.*, c.DATE_SUBMITTED CASE WHEN
>> a.SHIPMENT_IND = 'I' THEN a.reminder_date + 17 WHEN a.SHIPMENT_IND = 'O'
>> THEN a.reminder_date + 14 END as subn_due_date from mrs_dvs a,
>> mrs_company
>> b
>> LEFT OUTER JOIN mrs_main c ON a.GDV_NO = c.GDV_NO and a.SHIPMENT_IND =
>> c.SHIPMENT_IND and a.VESSEL_ID = c.VESSEL_ID WHERE trunc(reminder_date)
>> between to_date('01 nov 2007', 'dd MON YYYY') and
>> to_date('01 dec 2007', 'dd MON YYYY') and a.agent_cr = b.cr_co_code (+)
>> order by reminder_date desc
>>
>>
>>
>> If the below is the details from MRS_DVS :
>> GDV No = '1'
>> Shipment indicator = 'Y'
>> Vessel Id = '2'
>>
>> The SQL Statement will also return if GDV No = '1', Shipment indicator =
>> 'Y' and Vessel Id = '1' in MRS_MAIN as you have put an 'OR' statement?
>> This
>> is not correct as we only select only if all the 3 fields match. It
>> should be an 'AND' statement.
>>
>> I think outer join should be used. But I am not sure how do I specify
>> multiple parameters for outer join. Please advise.
>>
Re: OUTERJOIN [message #323246 is a reply to message #323243] Tue, 27 May 2008 22:09 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above
Re: OUTERJOIN [message #323252 is a reply to message #323243] Tue, 27 May 2008 22:50 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Take your query, put it in SQL*Plus and copy and paster your session but before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter).
Use the "Preview Message" button to verify.

Regards
Michel
Previous Topic: Query Output Question
Next Topic: Help in Pipelined function to extract records
Goto Forum:
  


Current Time: Sat Dec 10 20:28:26 CST 2016

Total time taken to generate the page: 0.16251 seconds