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…
Tag: oracle
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
SQL code does not work when converted to JPQL code (ORA-00904 error code)
Thank you very much for looking at this post :). I have the following problem: I have a piece of SQL code that runs perfectly on the Oracle database. The problem comes when I try to run as JPQL code. I get the following error in the Eclipse IDE: Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904:…
PL/SQL Dynamic SQL : Table name not valid
I’m currently learning PL/SQL. I need to create a PL/SQL block to create a backup of all my tables like this : myTable -> myTable_old. Here’s what I got right now : DECLARE Cursor c IS SELECT …
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 merge – unable to get stable set of rows after deleting duplicates
I have this query to merge data from the individuals2 table. I still get the “unable to get a stable set of rows” error after deleting all the full_name duplicates in individuals2. What am I missing? Answer Your problem might be in the lower(FULL_NAME)expression in the join condition. It is not en…
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
How to select data from day by day with special time?
I want to select data day by day. Condition: data will be cut the day from 10:00 pm to tomorrow 10 pm. For example: | REGTIME | T8 | T9 | T10 | | 2008-12-03 | 879 | 785| 542 | | 2008-12-04 | 556 | …
Adding a dot in a string in sql
I need to add a dot in two strings of numbers. (example “88188741478”). I need to add it 8 characters before the end. The result should look like this “881.88741478”. I need …