Skip to content

Tag: sql

duplicate elimination with time

For my Smart home Stuff I create a Database, but I make a mistake during programming: the application posting stuff into the Database twice. I want to delete all rows, which contain duplicates. With …

How to include a variable in a block WITH..AS?

I have this query to retrieve for each employee, his main and secondary function: Output : I want to integrate my previous query in the source query of my dimension : My expected output will be (for employee having EmployeeId=1) : Answer When you say: How to include a variable in a block are you asking how ca…

Find max value from coalesce function

This is my query: declare @t table (date1 date,date2 date,date3 date) insert into @t values (‘2019-01-01′,’2019-01-20′,’2019-02-10′) insert into @t values (null,null,’2019-02-01’) insert into @t …