Monthly Archives: June 2015

T-SQL Pivots a Table

This post demos how to pivot a table using both the Pivot function and a home made approach. The code can be found from GIST. Problem An OrderItem table contains orderId, itemName and qty as its columns. Now we want … Continue reading

Posted in Database | Tagged , , | 1 Comment

Use CTE and Table Partition and Ranking Functions to Delete Rows with Duplicates

This post demonstrates to use T-SQL table partition, row_number ranking function, together with CTE to delete duplicated data from a table. The logic is saved in a stored procedure for reuse purpose. Two Tables in the Example: Orders table uses … Continue reading

Posted in Database | Tagged , , , , , | Leave a comment

JQuery Moves Table Rows

JQuery can be used to easily relocate table rows. This post shows two of the manipulations: (1) Move a row to one row up or down, and (2) Move a row to another arbitrary position. This demo is illustrated by … Continue reading

Posted in Javascript & html | Tagged , , , , | Leave a comment