How to code Microsoft Excel "Shift Cells Up" feature in SQL

Posted by user293249 on Stack Overflow See other posts from Stack Overflow or by user293249
Published on 2010-03-29T21:08:22Z Indexed on 2010/03/29 21:13 UTC
Read the original article Hit count: 925

Filed under:
|
|
|

Take a simple table like below:

Column Headings: || Agent's Name || Time Logged In || Center ||
Row 1: Andrew || 12:30 PM || Home Base
Row 2: Jeff || 7:00 AM || Virtual Base
Row 3: Ryan || 6:30 PM || Test Base

Now lets say that a single cell is deleted so the table now looks like this:

Column Headings: || Agent's Name || Time Logged In || Center ||
Row 1: Andrew || 12:30 PM ||
Row 2: Jeff || 7:00 AM || Virtual Base
Row 3: Ryan || 6:30 PM || Test Base

Notice that "Home Base" is missing. Now in excel you can delete the cell and shift the rest so the finished product looks like below:

Column Headings: || Agent's Name || Time Logged In || Center ||
Row 1: Andrew || 12:30 PM || Virtual Base
Row 2: Jeff || 7:00 AM || Test Base
Row 3: Ryan || 6:30 PM ||

And you can see we are left with a blank cell last row.

How do I code this procedure of shifting the cells up in SQL?

I've been struggling on this problem for weeks! Thank you!

© Stack Overflow or respective owner

Related posts about sql

Related posts about excel