Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Update Sequence field for a table

Posted on 2013-06-25
5
Medium Priority
?
334 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 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?
0
 

Author Comment

by:damixa
ID: 39276420
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 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?
0
 

Author Comment

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

Author Closing Comment

by:damixa
ID: 39278849
Figured it out by myself, thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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…

972 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