Skip to content

Using SUM and CASE in Oracle SQL

I framed a query to get the counts grouped by a date column from 2 tables. select count(*),TO_CHAR(CREATION_DATE,’DD/Mon/YY HH’) as Date_TIME,’Table_1′ as TABLE_NAME from TABLE 1 where CREATION_DATE &…

Fiscal year and fiscal quarter

I have a table where I store order dates YYYY-MM_DD. How do I create fiscal year and fiscal quarter with the following requirements: Fiscal years: start date for Fiscal_Year_2000 is 1999-07-01 and …

SQL Data cleaning

I have a data set where I am trying to clean data. I want to remove the ** from email-address and phone_number and have just numbers in the phone_number column. how can i do it. Answer Here is one option using string functions: This removes ‘**’ from email, and all non-digit characters from phone_…