Headder AdSence

Can you define Equijoin?



The condition for matching the rows based on the equality of two values, one from each of the tables being joined. So that's what makes it an equijoin: the ON condition is equality. This includes inner joins and all three types of outer joins.



Capture

Please ask your Questions in comment box..

Finding Last Seven Days Data

How to find last seven days data and if any of days data is null then gives null.

This explanation about Oracle SQL Query:

Generally most of the people confuse here is how to handle NULL values.

so, here I am going to show you how we can do this.

I am taking Sales Date  and replacing NVL with SYSDATE means it treats like this is the Max or today date greater than or equal to SYSDATE-7 means seven days back date (ex 2017-11-4 - 7 days: 2017-10-29)

Query:

SELECT * FROM Tbl_Daily_Sales WHERE NVL(Sale_Date,SYSDATE) >= (SYSDATE-7);

Please find below Output:



Please give your valuable  comments & questions

How to Delete Duplicate Rows In Below Scenario

I have a sample data where the ID is unique, but there are multiple duplicate rows(excluding ID). The other columns are Name, Age, DOB, Transaction Date, Payment, Amount. I have purposely duplicated few rows, and kept ID unique.


--Deleting Duplicate 

;WITH Cte AS (SELECT ID,Name, Age, DOB, Transaction_Date, Payment, Amount, ROW_NUMBER() OVER(PARTITION BY Name, Age, DOB, Transaction_Date, Payment, Amount ORDER BY ID) Seq FROM #Temp) DELETE FROM Cte WHERE Seq<>1












Please Give Your Comments and Ask Some Questions: