Solved

Update Sequence field for a table

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

Date
Group
Status
Sequence_number

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
0
Comment
Question by:damixa
  • 3
  • 2
5 Comments
 
LVL 4

Assisted Solution

by:MrC63
MrC63 earned 500 total points
Comment Utility
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?
0
 

Author Comment

by:damixa
Comment Utility
No, just to run a query that does that. Not neccessarily a trigger, just running a manual query that performs this.
0
 
LVL 4

Accepted Solution

by:
MrC63 earned 500 total points
Comment Utility
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?
0
 

Author Comment

by:damixa
Comment Utility
yes, there is a primary key. it would be something like ID
0
 

Author Closing Comment

by:damixa
Comment Utility
Figured it out by myself, thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now