Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Update Sequence field for a table

Posted on 2013-06-25
Medium Priority
Last Modified: 2013-06-26
So i have a table with lets say four fields on table1


i need to update the sequence grouping the fields by the other three fields.

so if there are 4 records where Date, Group and Status are the same,  the Sequence_number would start at 101, 102, 103, 104 then start again at 101 for the next group of records where these three fields are the same.

thanks in advance
Question by:damixa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Assisted Solution

MrC63 earned 2000 total points
ID: 39276410
What do you expect to trigger this event / update?  Should it take place when you save a new record?  If that's the case, then perhaps you can explain how you're accessing the SQL database and/or storing the new record?

Author Comment

ID: 39276420
No, just to run a query that does that. Not neccessarily a trigger, just running a manual query that performs this.

Accepted Solution

MrC63 earned 2000 total points
ID: 39276553
Does this table presently have a unique ID key field, or is it only the 4 fields (and perhaps a few others) you've mentioned?

Author Comment

ID: 39276985
yes, there is a primary key. it would be something like ID

Author Closing Comment

ID: 39278849
Figured it out by myself, thanks

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question