How to get hourly records from one date to another date... Like how many orders we got every hour from 3rd March to 4th march.... Can u plz help me with the query
Hi Ganesh Sir..I have two tables..one has a Fiscal Month Description ( Jan-21, Feb-21) and in same table it has date range 1-Jan to 30-Jan as fiscal month 1-Feb- to 28-Feb as Feb 21. In second Table of Orders has Entry date..I am trying to find out the Description for each row in Orders. Any ideas please help Thanks in advance.
Hello ganesh, if we write a query like this select *from emp_null where job_id !='IT_PROD'; please explain the output, why not showing null results in this
Null value check to be done explicitly. I will rewrite like this (Job_id != 'IT_PROD' or job_id is null) OR NVL(job_id,'x') != 'IT_PROD'. In the second case, oracle will not use the index on job_id column if present
Sorry for delayed reply. Hope you have resolved it by now. One option is to get only input in HH:MM format, then it should be a char input and then you use the to_date function to convert into a datetime format. By knowing , how you are going to use the input, I can think of other alternatives.
Here you go... replace indata with your column name WITH ABC AS (SELECT '12|4567|90|abc|def' indata FROM dual) SELECT substr(indata,instr(indata,'|',-1,3)+1,instr(indata,'|',-1,2)-1-instr(indata,'|',-1,3)) Last_but_3, substr(indata,instr(indata,'|',-1,2)+1,instr(indata,'|',-1,1)-1-instr(indata,'|',-1,2)) Last_but_2, substr(indata,instr(indata,'|',-1,1)+1) Lastelement from abc;
Here you go for MySQL SELECT substring_index(substring_index("abc|123|4456|789","|",-3),"|",1) AS FromlastPosition3, substring_index(substring_index("abc|123|4456|789","|",-2),"|",1) AS FromlastPosition2, substring_index(substring_index("abc|123|4456|789","|",-1),"|",1) AS FromlastPosition3;
Hi Ganesh, I want the data between two dates and times ex 23.07.2020 5 am to 24.07.2020 5 am. Here I am changing the date everyday...which I don't want...how to get the 2 days data automatically between 5 am to 5 am