Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle current date minus 1 day

SELECT sysdate - 1 FROM dual; 				-- Yesterday    12/01/2021 14:27:27
SELECT trunc(sysdate) - 1 FROM dual; 		-- Yesterday    12/01/2021 00:00:00
SELECT sysdate - 1 / 24 FROM dual;					-- 1 hour ago
SELECT sysdate - 1 / 24 / 60 FROM dual;				-- 1 minute ago
SELECT add_months(trunc(sysdate), -1) FROM dual;   	-- 1 month ago (no time)
SELECT trunc(sysdate) - 30 FROM dual;				-- 30 days ago (no time)
SELECT add_months(trunc(sysdate), -12*2) FROM dual;	-- 2 years ago (no time)
Comment

PREVIOUS NEXT
Code Example
Sql :: fetch first 5 characters of the string in sql 
Sql :: shell mysql connect 
Sql :: mysql create table like 
Sql :: mysql parse int 
Sql :: sql server date format dd/mm/yyyy 
Sql :: sql server: select column values as comma separated string 
Sql :: like sql 
Sql :: mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password] 
Sql :: make a field auto_increment mysql 
Sql :: sql select between two dates 
Sql :: a network or instance-specific error sql server 
Sql :: create in sql 
Sql :: how to search date in sql query 
Sql :: sql insert inserted id 
Sql :: show data in table postgres 
Sql :: mysql date to string 
Sql :: sql where contains 
Sql :: sql select max value from multiple rows 
Sql :: what is my mysql version 
Sql :: psql connect as user with password 
Sql :: select top 10 rows in sql 
Sql :: column get from sql table 
Sql :: mysql set value as null 
Sql :: calculate distance between two latitude longitude postgresql 
Sql :: sql server update to null 
Sql :: mysql select tables with name like 
Sql :: print year of a date sql 
Sql :: postgresql casting integer to string 
Sql :: mysql timediff 
Sql :: mysql generate uuid 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =