Skip to content
Advertisement

Tag: oracle

Oracle calculate YTD ,PYTD, QTD , PQTD , MTD, PMTD

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,

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

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

Advertisement