Skip to content

INSERT or UPDATE from another table in mysql

I have two tables, with same schema – create table test1 ( a INT NOT NULL , b INT NOT NULL , c INT, PRIMARY KEY (a,b) ); create table test2 ( a INT NOT NULL , b INT NOT NULL , c INT, PRIMARY KEY (a,…

Time zone conversion in SQL query

I am using a query to get some application Received Date from Oracle DB which is stored as GMT. Now I have to convert this to Eastern standard/daylight savings time while retrieving. I am using the below query for this: It works fine for Standard time. But for daylight savings time we need to convert it to &#…

Execute a Stored Procedure Inside a View?

I started working for a company a few weeks ago, and have inherited a crazy mess of databases. I’m currently working on designing the new systems to replace their older ones. The previous developer created a ton of views that are entirely identical, with the only differences being the conditions within …