I have a table like this: room_id | name | time 1 | Kate | 2019-09-18 10:00:00.000 1 | Michael | 2019-09-18 12:00:00.000 1 | George | 2019-09-18 14:00:00.000 2 | Tom …
Tag: oracle
Convert varchar to date in Oracle SQL with month name
I have 2 columns in a large data set. Col 1 “review_date” is a varchar “September 16, 2019” I would like to have this information in DATE format as 09/16/2019 Col 2 “complete_date” is a varchar “…
How to write an SQL statement that runs only if condition is fulfilled?
I want to write a procedure that copies records from SYS.AUD$ to AUDIT_USER.AUDIT_HISTORY_TABLE and then TRUNCATE SYS.AUD$. I want Truncate to be executed ONLY if copy / insert went well. So …
Oracle SQL – Sum and group data by daily, weekly and monthly. (With missing date, week, and month)
I need to get total amount of transactions group by daily, weekly and monthly. What i’ve tried gave me the result I expected but not giving the date or week or month if there is no transactions on the …
What is the purpose of the string “- 4/24” from a record that holds a date?
I have an already generated script that uses the following code: ORDER BY TO_CHAR((A.VERIFIED_DTTM – 4/24),’YYYY-MM-DD’). The output of A.VERIFIED_DTTM is a simple date eg: 09-SEP-19. I was my …
How to fetch related source and destination Flights from table
Hi My table consists of: source destination LA BOS LA BOS Seattle BOS Bos LA BOS Seattle NY Seattle CA LA LA CA LA Chicago CA BOS BOS Seattle I am trying to fetch if my source either …
PHP copying the result from a SQL Query into a CSV file writes only the last line
I’m trying to take some results from a query that I do to Oracle and paste them on a CSV file, the problem is that, in the foreach loop, the code should writes line by line, but he writes only the …
How to execute a native SQL query having INTERVAL clause through Spring Boot JPA?
Not able to execute a native SQL query through Spring Boot Repository layer with JPA in Oracle DB I am trying to write a native SQL query that gets data from a table between the current date and last …
How to use multiple select queries inside c# by oracle
I need to select multiple select queries inside the C# code block. when I use it, I am getting an error such as an invalid character. I got that it is an error by using a semicolon inside the queries, Is there any solution for selecting multiple select queries? I am using Oracle.ManagedDataAccess ExecuteReade…
AM/PM Conversion For Date Time
I’ve a very basic requirement that I did earlier but for now unable to resolve it. I’ve a table in database that stores in and out time as the following format: 8/18/2019 8:00:00 AM So what I want …