Recently, I have been faced with a challenge of pivoting many tables. Every table was completely different, I needed some preprocessing steps, like filtering rows and so on. And I also didn’t want to ...
In this article, I am going to discuss How to Reverse the PIVOT Table in SQL Server. Please read our previous article before proceeding to this article where we discussed How to Implement PIVOT and ...
DECLARE @total_col VARCHAR(MAX) DECLARE @result NVARCHAR(MAX) SET @total_col='' SELECT @total_col = @total_col + QUOTENAME(item) + ',' FROM items SET @result=LEFT(@total_col, (LEN(@total_col)-1)) ...
Here’s something that will Blow Your Mind if you’re a Power Query/M fan. Did you know that there’s a way you can get query folding to work if you’re using a native SQL query on SQL Server or Postgres ...
I first came across the Value.NativeQuery() M function about six months ago, but it didn’t do anything useful then so I didn’t blog about it. I checked it again recently though and now it does ...
SUM(CASE WHEN monthname(sales_date) = 'January' THEN amount ELSE 0 END) as 'Jan-21', SUM(CASE WHEN monthname(sales_date) = 'February' THEN amount ELSE 0 END) as 'Feb ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results