Latest Entries »

SQL to get duplicate records

Here I’m going to show you the query to get all the duplicate records from a table. Below is a sample table Employee which has the duplicate data “Bangalore” in the Location column.

EmpTable

You can use the query mentioned below in order to get the duplicate records.

duplicateQuery

One of the ways to improve performance is to fetch only the required data from the database. By implementing a pagination technique in the stored procedure, it would help us in getting only the required set of records. This can be made possible by making use of ROW_NUMBER() which was introduced in SQL Server 2005. Below is a sample query which would fetch 10 records for each page.

pagination

ROW_NUMBER() requires the ORDER BY clause inorder to determine the sequence in which the rows are assigned their unique ROW_NUMBER within a specified partition. Hence as you see in the above query, I’ve used the “Name” column. By passing the @index value as 0, 10, 20…you can get the pagination effect for your data.

I have a table EmpData that has a column EmpData which is of xml data type. Below shown is the data of the table.

empTable

Now in case you would want to search the xml for a specific data. The query for that would be as shown below

empResult

At times we would want to programmatically select a page of a Datapager. As you can see, the code below shows a DataPager dpTest which is linked to the Listview lvTest.

pagination

In order to select the desired page programmatically you just need the code below:

dpTest.SetPageProperties(10, dpTest.MaximumRows, false);

Please note that the value 10 in the above code indicates the index of the first record on the page of data and not the page number you want to select.

British and American English

bA

The Evolution of Data Storage

evolutindata

We are so much dependent on gadgets these days, so much so that even for a simple math our immediate reflex would be to pull out our mobile from our pocket and open the calculator app.

I’m not sure if anyone has already thought of this, but then yesterday I was thinking, instead of wasting time unlocking the screen and searching for the calculator app on your phone, why can’t we just have the calculator app solve both the purpose. To unlock the screen as well as do some quick math.

I’ve managed to create a demo for this using my own HTC phone. As you can see in the video below, I just used the code “12255″ and then immediately pressed “=” to unlock the screen. :-)

 

The Bluetooth Bulb

Wow! The Next-Gen bulb is here. The Bluetooth Bulb lets you pair your phone with one or more lights in your home, and you can control them via an app. And the best part is, you will be able to control the brightness, the timing of turning the bulb on and off, and with the RGB model only your imagination is the limit of the number of colors you can create.

Definitions of Designations

Follow

Get every new post delivered to your Inbox.

Join 150 other followers

%d bloggers like this: