Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:11:57+00:00 2026-05-27T17:11:57+00:00

I have a TO DO Table with a Position Column. (other columns removed for

  • 0

I have a TO DO Table with a Position Column. (other columns removed for simplicity)

Description varchar(max)
Position int
JobFinished bit

If I have n amount of rows, each time a row is added the position is incremented. So values may look like this:

Drop Off Kids,   0, 0 
Get Groceries,   1, 0 
Pickup Kids,     2, 0

Now, If I do something I want to remove it from the table. And increment all other position columns so they are in order from 0.

Ie If I Get Groceries I need the values to look like this:

Drop off Kids,  0,    0
Get Grocerieis, NULL, 1
Pickup Kids,    1,    0

Is there any way with SQL I could do this?
(Im using SQL server)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:11:57+00:00Added an answer on May 27, 2026 at 5:11 pm

    This is very simple SQL question, just check your sql server reference, for the update SQL statement:

    update todo_table set position = position -1 where position > 1;
    update todo_table set position = NULL, JobFinished = 1 where Description='Get Grocerieis'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with the columns word, length, position, count and definition .
I have this fairly straightforward table with ID , Position , Name columns. ID
I have a table items with a column position. position has a unique and
Suppose I have a table of users. Something like: ID integer, USER text, POSITION
I have table with 3 columns A B C. I want to select *
I have table column filled with float values e.g.: id-Values 1- 0.19230769230769232 2- 8.4848484848484854E
In this table, there is a column called 'position'. This column counts up from
I have a table with some columns. In each of them is a picture
I have a table of results I'd like to display: | change | position
I have a table with data representing a tree structure, with one column indicating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.