Skip to content

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

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: