Skip to content

Tag: oracle

SQL Create View with a new column to hold values from DateDiff

I have the following SQL code to create a view called v_students and I want to use the DATEDIFF() function to find the difference between the current date and the registration_date and then place those values in a new column called DaysSinceRegistration. I am running into an issue where there is a syntax erro…

Oracle Cannot retain data

I have oracle database installed on my system I access it through command line. I had created a user and I created a table Inserted few records. then I exit Problem is that when I try to login again. table is still there. But the data which I had inserted is gone. OUTPUT Answer SQL*Plus has option to auto-com…

Oracle – Parsing Multiple JSON Values in a single SQL query

I have data in PersonalDetails table in JSON format, I am trying to parse the data in a single query, currently I am using JSON_TABLE functions, in my query I am only able to parse only one column, if I try to use JSON_TABLE functions twice it throwing me an error, is their a way to parse all the columns

Eliminate duplicate values and replace them with null values oracle?

I have a table like But my desired table is Rule here is Replacing dest2 by null if it appears once and Replacing dest1, dest2 by null if dest1 appears once… Answer You seem to be null’ing out dest2 after it appears once, and the pair when both appear. Assuming that source provides the ordering, y…