Skip to content

Tag: sql

Calculating a Moving Average MySQL?

Good Day, I am using the following code to calculate the 9 Day Moving average. But it does not work because it first calculates all of the returned fields before the limit is called. In other words it will calculate all the closes before or equal to that date, and not just the last 9. So I need to calculate

Oracle SQL. How to execute query one by one

Could you help me, how can I execute query one by one in Oracle SQL Developer? When there’s one query system works correctly. But when I write 2 or more and press “ctrl” + “enter”, System marks out all queries and trying to execute all of them. Answer Separate each query by semi-…

Using SQL Merge or UPDATE / INSERT

I have a table (Customer_Master_File) that needs to updated from flat files dumped into a folder. I have an SSIS package that runs to pick up the flat files and imports them into a temp table (temp_Customer_Master_File) What I have been unable to do is this: for each record in the temp table, if the Customer_…