Home » SQL & PL/SQL » SQL & PL/SQL » SQL Syntax Error
SQL Syntax Error [message #571942] Tue, 04 December 2012 13:07 Go to next message
Saya22
Messages: 14
Registered: December 2012
Location: London
Junior Member
Hello,

I'm working on Oracle SQL Developer: ODMiner. I keep getting a syntax error with the following code,


CREATE TABLE FINAL_WEBLOG AS
select SESSION_DT, C_IP, CS_USER_AGENT,
LISTAGG(WEB_LINK, ' ')
WITHIN GROUP (ORDER BY C_IP, CS_USER_AGENT) "WEB_LINKS",
FROM WEBLOG_VIEWS
GROUP BY C_IP, CS_USER_AGENT, SESSION_DT
ORDER BY SESSION_DT

I understand if it's the semicolon that is missing at the end, but I'm not sure on how I can rephrase it correctly.

The error I got was,

Error at Command Line:5 Column:2
Error report:
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
Re: SQL Syntax Error [message #571944 is a reply to message #571942] Tue, 04 December 2012 13:46 Go to previous messageGo to next message
BlackSwan
Messages: 23040
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/


start by making a valid SELECT statement
Re: SQL Syntax Error [message #571945 is a reply to message #571942] Tue, 04 December 2012 13:55 Go to previous messageGo to next message
Michel Cadot
Messages: 59762
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Welcome to the forum.

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Use SQL*Plus and copy and paste your session.

With any SQL or PL/SQL question, please, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Regards
Michel

Re: SQL Syntax Error [message #571946 is a reply to message #571944] Tue, 04 December 2012 13:57 Go to previous messageGo to next message
Saya22
Messages: 14
Registered: December 2012
Location: London
Junior Member
I found my mistake.. Smile Thanks anyway!
Re: SQL Syntax Error [message #571947 is a reply to message #571946] Tue, 04 December 2012 14:18 Go to previous messageGo to next message
BlackSwan
Messages: 23040
Registered: January 2009
Senior Member
>I found my mistake.
please share solution here so others can benefit.
Re: SQL Syntax Error [message #571949 is a reply to message #571947] Tue, 04 December 2012 15:17 Go to previous message
Saya22
Messages: 14
Registered: December 2012
Location: London
Junior Member
WITHIN GROUP (ORDER BY C_IP, CS_USER_AGENT) "WEB_LINKS",


No comma at the end.. it was a silly mistake on my part ^ ^'

WITHIN GROUP (ORDER BY C_IP, CS_USER_AGENT) "WEB_LINKS"

[Updated on: Tue, 04 December 2012 15:18]

Report message to a moderator

Previous Topic: Create TSV file
Next Topic: Sequence increments when it is not being called.
Goto Forum:
  


Current Time: Mon Nov 24 16:05:10 CST 2014

Total time taken to generate the page: 0.23447 seconds