I am trying to create a new column in SQL with certain conditions in DBVisualizer by connecting redshift data source. I used the following command to achieve the results but getting syntax error. I would be really grateful for any help. Code: Error: Expected Output: Thanks. Answer As stated in the error message, the IF() function does not exist in
Tag: dbvisualizer
SQL Month YTD and prior YTD data
I am trying to write a query to return Month-To-Date data for the Current Year, and also the Previous Year. Meaning I need data from 2017-07-01 to 2017-07-26 and also 2016-07-01 to 2016-07-26. However, my query currently returns data from 2017-07-01 to 2017-07-26 (correctly) but also returns data from 2016-07-01 to 2016-07-31 (incorrectly). How can I have the data for