Posts

Showing posts from 2018

stateSave -State saving - restore table state on page reload.

Image
stateSave -State saving - restore table state on page reload. Enable or disable state saving. When enabled aDataTables will store state information such as pagination position, display length, filtering and sorting. When the end user reloads the page the table's state will be altered to match what they had previously set up.

Difference between ROW_NUMBER(),RANK() and DENSE_RANK() function in SQL

Create table #tamp ( EmpID   int identity ( 1 , 1 ) primary key ( EmpID ), Name varchar ( 200 ), Salary int ) select * from #tamp --insert into #tamp values('Rahul',10000) --insert into #tamp values('Vishal',15000) --insert into #tamp values('Mehul',20000) --insert into #tamp values('Hiren',15000) --insert into #tamp values('Amit',15000) --insert into #tamp values('Mihir',20000) ROW_NUMBER() Function keeps increasing integer by one and it is not caring duplicate values RANK() and DENSE_RANK() functions are looking for duplicate values RANK() Function The integer value is increasing by one but if the same value (Salary) is present in the table, then the same integer value is given to all the rows having the same value(Salary) Select * , RANK () over ( order by salary desc ) as rank , DENSE_RANK () over ( order by salary desc ) as denserank , ROW_NUMBER () over ( order by sal...