How do I reset a sequence in Oracle

0 votes
Sep 27, 2019 in Database by Daric
• 500 points
333 views

1 answer to this question.

0 votes

 If you want to set it to 0, you can just delete and recreate it. If you want to set it to a specific value, you can set the INCREMENT to a negative value and get the next value. That is, if your sequence is at 500, you can set it to 100 via

ALTER SEQUENCE serial INCREMENT BY -400;
SELECT serial.NEXTVAL FROM dual;
ALTER SEQUENCE serial INCREMENT BY 1;
answered Sep 27, 2019 by Omaiz
• 560 points

Related Questions In Database

0 votes
1 answer

Reset a sequence in Oracle

You can try out something like this create ...READ MORE

answered Sep 24, 2018 in Database by DataKing99
• 8,240 points
3,292 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

MERGE INTO YourTable T USING ...READ MORE

answered Feb 3 in Database by Vaani
• 7,020 points
74 views
0 votes
0 answers

How do I UPDATE from a SELECT in SQL Server?

INSERT INTO Table (col1, col2, col3) SELECT col1, ...READ MORE

Feb 4 in Database by Vaani
• 7,020 points
29 views
0 votes
1 answer

How do I display a ratio in Excel in the format A:B?

Try this formula: =SUBSTITUTE(TEXT(A1/B1,"?/?"),"/",":") Result: A B ...READ MORE

answered Apr 1 in Database by gaurav
• 17,580 points
42 views
0 votes
1 answer

How do I split a cell in Excel into two or more where they are divided horizontally?

Table cells should be combined. To make a ...READ MORE

answered Apr 6 in Database by gaurav
• 17,580 points
93 views
0 votes
0 answers

How do I list all the columns in a table?

For the various popular database systems, how ...READ MORE

Aug 9 in Database by Kithuzzz
• 4,480 points
11 views
0 votes
0 answers

How can I set a custom date time format in Oracle SQL Developer?

Date values are shown in Oracle SQL ...READ MORE

4 days ago in Database by Kithuzzz
• 4,480 points
2 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by Sahiti
• 6,380 points
1,681 views
0 votes
2 answers

How to select the nth row in a SQL database table?

SELECT * FROM ( SELECT ID, NAME, ROW_NUMBER() ...READ MORE

answered Apr 23, 2020 in Database by anand
• 140 points
16,958 views
0 votes
1 answer

showing an error in a MySQL trigger

use this code: CREATE TRIGGER sample_trigger_msg ...READ MORE

answered Sep 27, 2019 in Database by Omaiz
• 560 points
748 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP