Skip to content

Tag: oracle

Compare dates between two dates at specific positions

Given the following sample records within the table: MY_DATES, using Oracle SQL and/or PL/SQL, I need to always take the first DATE_REGISTERED in this table, i.e. 26/10/2019 and then advance to the third DATE_REGISTERED record/value, i.e. 2/02/2020 and check if the difference is greater than 13 weeks, between…

How to returns number of rows incrementally based on column values

I have departments and issues tables. For every department there are approval levels. So if say HR department has 3 approval levels, i want the drop down to return a new alias column as Y1,Y2,Y3. Similarly if finance has 2 it should return Y1 and Y2. Is it possible in sql? As of now the first alias column is …