Requirements Single-lines comments (e.g. — my comment) should be removed. Multi-line comments (e.g. /* my comment */) should be removed. The content of strings literals (e.g. ‘this is a multi-line comment: /* my comment */’) should be ignored. The content of identifiers (e.g. “– …
Tag: oracle
Comma-delimit multiple columns when some values may be null
I need to comma-delimit the values contained in multiple columns, when each of the columns could contain a NULL value: Results: Is there an approach that is less cumbersome than what I’ve done for abc, preferably without having to use PL/SQL? Answer The function that you really want is concat_ws(), but …
group some row in resilt table
I need get a group some row select from result table. I’ve written select but have error message ORA-00913. How to write a correct select ?I have a result table: and insert: and I need to get result table: I’m trying: but ora-00913 too many values How to write correct “select” ? Sorry,…
Find closest or higher values in SQL
I have a table: table1 I have to generate the following table: table2 So, table2 should have all values from 1 to 100. There are 3 cases: If it’s an exact match, for ex. rank 25, value would be 120 Find closest, for ex. for rank 9 in table2, we do NOT have exact match, but 1 is closest to
Creating a CTE in Oracle
I am trying to create a CTE in Oracle that doesn’t select from an existing table but instead has data inserted into it. Currently, I am creating a table and then dropping it after the query is done. …
SP2-0552: Bind Variable “NEW” is not declared
I am trying to learn pl/sql triggers. I am trying to create a simple trigger by tracking tutorial http://www.tutorialspoint.com/plsql/plsql_triggers.htm but I got below error. I searched on the …
How to get the schema name when I have table name – Oracle
I have a table name but I am not sure in which schema that table exists. How to find the schema name?
How to get Oracle database version?
How to get Oracle database version from sqlplus, Oracle SQL developer, SQL Navigator or other IDE? Answer Execute this statement from SQL*Plus, SQLcl, Oracle SQL Developer, SQL Navigator or other IDE: And you’ll get:
Oracle – Find the group of most consecutive occurrence of a value in a column
I have a table structure called test_table like this: and so on.. It is a large table and has about 3000 rows. I want to find the section of the table (start and end timestamp) for the longest running occurrence of “C” values. For example in the above case it would be 8:46:59 to 8:48:55. Is there …
Can only find table in Oracle SQL when surrounding the table name with double quotes. Why?
I’m having the following weird issue with Oracle SQL. I have a table called schema_version, but I can’t run simple selects over it: > SELECT * FROM schema_version; ORA-00942: table or view does …