I’ve got a rather unusual question about some database query with oracle. I got asked if it’s possible to get the number of cases where the patient got a resumption on the same station they were discharged from within 48 / 72 hours. Consider the following example: Case Station From To 1 Stat_1 202…
Tag: oracle
Oracle SQL: Transfer certain records from one table to another filtering rows based on condition
Need to transfer certain records of some columns from Table1 to Table2 but filtering rows based on condition. Lets say Table1 looks like as shown below, has many columns in it. In Table2, need to insert rows from Table1 based on following: First, select A, B, C, D, E, F from Table1 where D=’xyz’ a…
Oracle SQL Select Only 5 Digit Row in a Column [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question SLNO Column select only 5 digit row Answer Please use length function of or…
how to get the count of data based on status id in sql
i have following table id statusid 100 1 100 2 100 3 101 1 101 3 i am getting the result like following id data1 data2 data3 100 1 1 1 101 …
Nvl function with multiple row set in oracle
I have a problem with NVL function in oracle. If I send periods variable as null it is working.There is no data in query.I mean NVL function is working properly. If I send periods variable as for …
Date Conversion Issues ORACLE SQL
this is going to be a totally newb question but my google-fu isn’t landing me anything timely so I figured I would ask you Trying to do this query: But the predicate column is formatted as such: I’m guessing my TO_CHAR and CAST isn’t sufficient due to the error: Anyone happen to know off the…
call oracle function with parameters
I started to learn pl/sql.I have problem with functions.I created a function like this I want to call this function like this select GET_RANK_INFO(‘12345′,to_date(’10/03/2019′,’dd/mm/yyyy’),null) from dual; but it gives error like that the number of argument types invoked i…
Fetch the difference in result in Oracle
I have two tables table_one and table_two. table_one has incomplete records while table_two has all records I want to fetch the difference in each date id_date, however i cant get results in a date …
How can I select a nested json object with a group by clause in oracle sql from a table?
Let’s say I have the following statement: WITH t AS ( SELECT ‘A’ AS level_0, ‘A1’ AS level_1_1, ‘object_1’ AS level_1_2, ‘A11’ AS level_2_1, ‘B11’ AS level_2_2 FROM dual UNION ALL SELECT ‘A’ AS …
ORA-01861: literal does not match format string use oracle SQL
I have data field in oracle database, i need to update my data field and use add_months function to add 3 more month as show below, my table name psm_voucher. then I try update query as below but fail Your kinds help is much appreciated. Answer As date in your table is stored as a string, you will need to