Posts

Showing posts from May, 2015

How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

Convert colum to row without using unpivot operator

Image
In this post I will show you how to convert column to row in SQL.For this post I am going to use following table which have three colum stu_name,sibject and marks.SELECT stu_name, MAX(CASE WHEN subject = 'ECO' THEN marks ELSE 0 END) ECO, MAX(CASE WHEN subject = 'HIS' THEN marks ELSE 0 END) HIS, MAX(CASE WHEN subject = 'MAT' THEN marks ELSE 0 END) MAT, MAX(CASE WHEN subject = 'GEO' THEN marks ELSE 0 END) GEO, MAX(CASE WHEN subject = 'SCI' THEN marks ELSE 0 END) SCI FROM col_to_rows GROUP BY stu_name