Home » SQL & PL/SQL » SQL & PL/SQL » Getting Error with Cross join query
Getting Error with Cross join query [message #413211] Tue, 14 July 2009 15:42 Go to next message
aswani7
Messages: 14
Registered: July 2009
Junior Member
Hello All,

i am new to this forum,

i have a bit knowledge in oracle, while issuing below query i am getting error

SELECT
A.FacilityName || '/' || B.FacilityName,
TO_CHAR(A.FacilityNum) ||',' || TO_CHAR(B.FacilityNum)
FROM hsi.MedFacility as A CROSS JOIN hsi.MedFacility as B
where A.FacilityName='KOOLA' and B.FacilityName='TIMITY';



Error starting at line 1 in command:
SELECT
A.FacilityName || '/' || B.FacilityName,
TO_CHAR(A.FacilityNum) ||',' || TO_CHAR(B.FacilityNum)
FROM hsi.MedFacility as A CROSS JOIN hsi.MedFacility as B
where A.FacilityName='KOOLA' and B.FacilityName='TIMITY'
Error at Command Line:4 Column:35
Error report:
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Re: Getting Error with Cross join query [message #413215 is a reply to message #413211] Tue, 14 July 2009 15:50 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Hello, and welcome to the forum

Please be sure to check out the Forum Guide on how to format your post so that it is better readable, and other things that are good to know.

Concerning your problem, Oracle doesn't like the "as".

Try it with out the "as" in the "as A" "as B" parts.
Re: Getting Error with Cross join query [message #413217 is a reply to message #413215] Tue, 14 July 2009 16:27 Go to previous messageGo to next message
aswani7
Messages: 14
Registered: July 2009
Junior Member
Hello Thomas,

yes its worked fine



with AS key word

Thank you very much

Best Regards
asita
Re: Getting Error with Cross join query [message #413254 is a reply to message #413217] Wed, 15 July 2009 00:49 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Before your next question, 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 code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Previous Topic: sql
Next Topic: Querying a materialized view while its refresh is on.
Goto Forum:
  


Current Time: Sat Dec 10 08:44:05 CST 2016

Total time taken to generate the page: 0.13317 seconds