Skip to content

Tag: oracle

How to Loop department names

Oracle SQL Developer I want to Loop department id and department names starting from dep_id = 10 and till 50th department. Departments are increasing by 10, so, there are 5 departments from 10 to 50. Here’s my code And here is the output, But as you can see the Administration row is repeating itself. Th…

Is there a way to change the output row name in Oracle?

I have Procedure which removed/deleted the lowest lnr. The code works fine. So my question is, if there is anyway I can make my output better. I’ve tried following: But it doesn’t work like it does in SSMS. I would like to have output such as: Answer You could simply add a column for status

weekly max count record in oracle

table test has column id,created_date,sal and data like below: ID create_date sal 1 20-JAN-2021 5000 2 20-JAN-2021 6000 3 19 -JAN- 2021 4000 we have data like this for each date. I pick the each day record count using below query: I want output for max record count for a weekly basis: count(*) create_date 500…

all combination of two symbol with nth length

I need a solution using only oracle sql query Input two static symbol ‘A’ and ‘B’ n – number Output if N=3 must give all combination using this symbols AAA AAB ABA BAA … Output if N=4 must give all combination using this symbols AAAA AAAB AABA ABAA … Answer Old style …

Oracle SQL: Get the previous values

I have two columns table: Id, and value. ID Value 1 2 AA 3 4 BB 5 6 7 8 CC 9 I need a query in Oracle to return the result as ID Value 1 2 AA 3 AA 4 BB 5 BB 6 BB 7 BB 8 CC 9 CC Is there anyway to do this? Thanks in