SQLTeam.com | Weblogs | Forums

Build monthly retention matrix

Hello I need to build a monthly retention matrix using SQL having userID, registration date and paste date

Please provide DDL, sample data and expected results. The description you provided isn't enough information to provide any help

Hi there please look at the sample

Pictures don't help. We need readily consumable DDL, sample data and expected results. Here's a start of what we need, but no idea what you are expecting as a result. Also, you mention userId, but have courier in your pic

create table #t (Id int identity(1,1) not null primary key,
				Courier varchar(20),
				RegDate date,
				LastOrderDate date)

insert into #t values

Thank you it means if I insert all those value in the created table will I be able to have the monthly retention result ?

The courier Can be use as ID since it is numbered

I also want to share the excel file but the systems not accepting

I found an article on how to solve that easily please can you help me with this ?

Again, there is nothing you've added that we can use to help you. I provide some DDL and sample data, but you again show another picture. Please use what I gave you to provide what you want. Don't paste pictures, but readily consumable code