Skip to content
Advertisement

Tag: oracle

Modify generated column in Oracle

I have created a database table in Oracle with an auto generated column: Now I do not need it to be generated automatically. I tried to write: But it did not work. The database gives an error: Can someone please explain how to solve this issue without dropping the column? Answer (There’s no such thing as “PLSQL database”; PL/SQL is

How to find a salary which does not end with Zero

I have been trying to write a query where I need to find a salary which does not end with ZERO My Query : select salary from employees where REGEXP_LIKE (Salary, ‘^(1|2|3|4|5|6|7|8|9)$’); Answer I would just use the modulus here: By definition, the modulus 10 returns the single (final) digit in the salary. Going this route avoids a costly conversion

Oracle SQL conditional operator explanation

Please, may I ask if anyone can explain more on the following oracle sql conditional operator please ? I only have limited oracle sql knowledge that it exclude checking for Sat and sometime for Sunday. Thanks so much! Answer The decode is basically checking the day of the week and returns some magic number = 4, which seems to be

subtract certain date from two dates

Let’s say it is announced that 4 Aug 2022 is a public holiday. I have a table which shows the holiday_start and holiday_end dates. How do I exclude this date “4 Aug 2022” by inputting any date i want (bind variable) and showing it as excluded day eg. leave is from 01-Aug-2022 -> 10-Aug-2022 excluded days= 1 i’ve tried this:

Advertisement