Skip to content

Tag: oracle

oracle add column with value based on condition

I would like to add a column “tag” based on value of “LEASE_ID_count” with ORACLE. But i get this error : value too large for column “CUSTOM_LIFETIME_VALUE_TAG”.”tag” (actual: 7, maximum: 3) , caused by: OracleDatabaseException: ORA-12899: value too large for co…

Is there anyway to test the function in SQL?

I have following problem. I’ve made an function which checks dates, warehouse if it’s full, etc.. Here is the code and I’ve added comments so it is more clear and understanble: So basically if I run only the function I don’t get any error. But when I run it with the test date I get fol…

How to unite two SQL statements when referencing a few tables

I have the following TABLES and RECORDS. I need to answer the following query: Find the names of all the teachers that Ann Chin has, along with all her classes and midterm grades from each. So far, I have tried many SELECT combinations, but I keep getting duplicate values and returns. This is the closest I ha…

How to create teble 3 from data of table 1 and table 2

t1 (ordered descending): a comment 512 (ordered desc) 415 310 205 195 150 132 90 74 20 1 t2 (ordered ascending): b comment 10 (ordered asc) 11 12 13 I would like to create t3: a (desc) b comment 512 10 (b=asc) 415 11 310 12 205 13 195 13 (b=desc) 150 12 132 11 90 10 74 10 (b=asc)

Oracle hierarchical queries data

The link gives a good example for overview on how to use Oracle hierarchical queries. I was trying to generate the below combination of data with the example table tab1 given in the link but struck …