Why does the query produce an right parenthesis: Error report – ORA-00907: missing right parenthesis 00907. 00000 – “missing right parenthesis” I have tried everything on where to put the right parenthesis and it is not working. Here is my code: Answer Add a comma after “Customer_ID NUMBER NOT NULL”. That should fix the issue.
Tag: oracle
How to create table from an existing table
I’m in Oracle APEX and would like to create a new table from other existing one like this: I have a column in a SONGS table that is: ARTIST NAME Another header Bad Bunny row Bad Bunny, Ozuna, Daddy Yankee row And I want this in another table: ID Artist 1 Bad Bunny 2 Ozuna 3 Daddy Yankee Also, from
select running by itself but not in subquery
Ok so I’m stuck at something and I need your help. How can this run ok: and this not? The error I get is: 00907. 00000 – “missing right parenthesis” Answer In SQL, in general, table ordering is non-deterministic and an order cannot be guaranteed. Your query: Will fetch rows from the table in a non-deterministic (random) order1 and then
Is there a way to group values getting only the ones that verifies certain condition?
I’m trying to write a query in Oracle SQL that aggregates values by some ids, where I have the following table as an input: ID SOME_DATE RANK_POSITION 301 20211201 1 301 20211202 2 301 20211203 3 649 20211201 1 649 20211202 2 649 20211206 3 649 20211208 4 649 20211211 5 758 20211212 1 758 20211222 2 And y want
How is this cardinality being calculated in Explain plan?
I am analyzing the “explanation plan” about the following instruction and Oracle SQL Developer tells me that it has a cardinality of 1513 and cost of 1302. How are these calculations performed? Could be reproduced with an instruction (calculate with a select and obtain de same value)? Answer The cardinality generated by an explain plan can be based on many
Revisting ORA-06576: not a valid function or procedure name for simple function call via various database tools
Revisting ORA-06576: not a valid function or procedure name for simple function call via dbeaver database-tool I have seen many posts, but they don’t cover the situation I am experiencing. I am trying to do a simple function call to Oracle SQL via dbeaver: According to the right-click call function obtained via dbeaver the function syntax it is: To be
Output records with null values even if not present
I have a table as below in Oracle gen_id serial_code is_verified 1 fmcg Y 1 smcg Y 1 xmcg N 2 smcg Y 2 fmcg Y 2 2mcg Y 3 smcg Y 3 amcg Y Now I want the output for max gen_id which is 3 in this case and serial_code ‘smcg’ and ‘fmcg’ I can get the output easily
PL/SQL CREATE PROCEDURE – Salary increase based on tenure
I have worked on this for a while but the code did not work and I could not figure out the correct solution. Did I miss something from the code? Thank you. — Question – The company wants to calculate the employees’ annual salary: –The first year of employment, the amount of salary is the base salary which is $10,000.
Multiple tables joined to a table via single column
I am trying to create query, on below scenario. with my skills I am able to join Table A,A1,B and A,A1,C and A,A1,D individually and union them. Is there any better way to achieve same. I am using Oracle as Database. Answer It all depends on what they mean and if you need to know the columns the values are
Find top parent of child, multiple levels
I make copies of the entries in some cases and they are conneted by parent ID. Each entry can have one copy: Sometimes I need to take a copy and query for it’s top level parent. I need to find the top parent entries for all the entries I search for. For example, if I query for the parents of