ora-00933

SQL Inner join on select statements

拟墨画扇 提交于 2019-11-27 17:22:57
问题 I am trying to make an inner join on a select statement like this: select * from (select* from bars where rownum <= 10 )as tab1 inner join (select * from bars where rownum <= 10 )as tab2 on tab1.close=tab2.close and I get the following error: ORA-00933 SQL command not properly ended Any help would be appreciated, thank you! 回答1: Just remove as from your query: select * from (select* from bars where rownum <= 10 ) tab1 inner join (select * from bars where rownum <= 10 ) tab2 on tab1.close=tab2

ORA-00933: SQL command not properly ended

混江龙づ霸主 提交于 2019-11-27 15:42:14
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_tbl values('4327142', 0, TO_DATE('03/23/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '51', TO_DATE('03/23/2002', 'MM/DD/YYYY'), 0.000000, 0.000) The first insert succeeds but the second one gives an error: ORA-00933: SQL command not properly ended What am I doing wrong? massimogentilini To me it seems you

Oracle Update Query using Join

天大地大妈咪最大 提交于 2019-11-27 05:42:08
I am trying to update the amount using Join but getting exception: UPDATE tab1 SET tab1.total_adjusted_cost = tab1.total_adjusted_cost + t1.total FROM table1 tab1, (SELECT tab3.name, tab3.add, SUM(tab2.amount) AS total FROM table2 tab2, table3 tab3, table4 tab4 WHERE tab2.id = tab3.id AND tab3.id = tab4.id AND tab4.indicator = 'Y' GROUP BY tab3.name, tab3.add ) t1 WHERE tab1.id = t1.id; SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" Try to use merge merge into table1 tab1 using ( SELECT tab3.name, tab3."add", SUM(tab2.amount) AS total FROM

SQL Command not properly ended?

萝らか妹 提交于 2019-11-26 22:01:59
问题 I am using a SQL statement with a Temporary relation, and am getting the error ORA-009933: SQL command not properly ended I don't see anything wrong with the statement, so any assistance is greatly appreciated. The statement is: SELECT Temp.name, Temp.AvgSalary FROM (SELECT A.aid, A.aname AS name, AVG(E.salary) AS AvgSalary FROM Aircraft A, Certified C, Employees E) AS Temp; Thanks 回答1: oracle does not support as for table aliases, only for column aliases and they are optional for that use =>

ORA-00933: SQL command not properly ended

依然范特西╮ 提交于 2019-11-26 17:16:47
问题 I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert: insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_tbl values('4327142', 0, TO_DATE('03/23/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '51', TO_DATE('03/23/2002', 'MM/DD/YYYY'), 0.000000, 0.000) The first insert succeeds but the second one gives an error

Update statement with inner join on Oracle

柔情痞子 提交于 2019-11-25 21:37:59
问题 I have a query which works fine in MySQL, but when I run it on Oracle I get the following error: SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - \"SQL command not properly ended\" The query is: UPDATE table1 INNER JOIN table2 ON table1.value = table2.DESC SET table1.value = table2.CODE WHERE table1.UPDATETYPE=\'blah\'; 回答1: That syntax isn't valid in Oracle. You can do this: UPDATE table1 SET table1.value = (SELECT table2.CODE FROM table2 WHERE table1.value = table2.DESC)