My query is Im new to oracle and in my query i have hard coded the values of year ,month and quarter. But i want my query to work without giving any value so that it automatically picks value let me know how can it be done. Answer You can use: (Although I’m not convinced you want the initial ENTRIES,
Tag: oracle
why subtracting two time doesn’t work properly in oracle
I want to calculate system time till that day 17:00 in minutes in plsql, and I write the below query but it doesn’t work : can someone help me? Answer My guess is that you want If that isn’t what you want, it is helpful to provide some details and a test case to show exactly what you want to
SQL – count function not working correctly
I’m trying to count the blood type for each blood bank I’m using oracle DB the blood bank table is created like this when I use the count function the result would be like this so why the count function is not working correctly? I’m trying to display each blood bank blood type count which is not only one in
Get rows which contain exactly one special character
I have a SQL query which returns some rows having the below format: How can i filter to get rows which only have the format of ‘DB_host’ (place a condition to return values with only one occurrence of ‘_’) i tried using [0-9a-zA-Z_0-9a-zA-Z], but seems like its not right. Please suggest. Answer One option would be using REGEXP_COUNT and at
ORA-00904: “GRADE_RANK”: invalid identifier
This query runs without grade_rank > 1 but I want only the results where grade_rank is > 1. I have tried using ROW_NUMBER() OVER() as grade_rank but it didn’t work. SELECT student_id, …
Simple database with 3 tables and “no matching unique or primary key for this column”
I have three tables, two are created independently, and the third one is created to include some inputs from the first two. First two tables have no problems, however, when I try to create the third one, I get an error: The thing is, I created the third table by copy/pasting the column names/definitions right from the first two tables,
Error: ORA-12154: TNS:could not resolve the connect identifier specified when entering username and password in sql plus
I’m trying to login to my oracle database using sql plus. But such error out ORA-12154: TNS:could not resolve the connect identifier specified here is my tnsnames.ora file, sqlnet.ora file and …
2 column with 2 different condition in one table
is it possible to create a query that will output 2 column with 2 different WHERE clause this my ideal output: where count 1 is the result of the 1st WHERE clause. Which I already created. What I want is to have another column where in the value will be with different WHERE clause. here’s my query: with this query
Oracle SQL Subquery – Usage of NOT EXISTS
I used a query to find a list of Primary Keys. One Primary key per each ForiegnKey in a table by using below query. Let us say this is the result : 1,4,5 NOw I have another table – Table B that has list of all Primary keys. It has 1,2,3,6,7,8,9 I want a write a query using the above
filter timestamp column in SQL Oracle
I have a table with a Timestamp column which I need to filter after ‘2020-08-26’, but every solution won’t work RUN_TIME 2020-07-22 04:22:07 2020-07-22 04:34:07 2020-07-22 04:45:07 2020-07-22 04:50:07 …