Home » SQL & PL/SQL » SQL & PL/SQL » Single Update Query
Single Update Query [message #337252] Wed, 30 July 2008 05:15 Go to next message
Messages: 29
Registered: December 2007
Location: http://maps.google.com/ma...
Junior Member

line_no name
1 aaa
1 bbb
1 ccc
1 ddd
1 eee

I have a table called tbl_ins_main
in this table, a column called line_no.
which holds a value of 1.

table contains 5 rows.

how to update this table (5 rows) by single update statement - with incrementing line_no value by 1 for each row.

how to update the table by single update query?
actually the table look like:

line_no name
1 aaa
2 bbb
3 ccc
4 ddd
5 eee

Re: Single Update Query [message #337253 is a reply to message #337252] Wed, 30 July 2008 05:19 Go to previous message
Michel Cadot
Messages: 63917
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As already been asked to you: follow the guidelines, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

You have to first know how to order the rows in your table, then use rownum pseudocolumn for instance.

Previous Topic: PLSQL Procedure
Next Topic: How many rows and columns can be designed in a table..
Goto Forum:

Current Time: Mon Oct 24 22:31:55 CDT 2016

Total time taken to generate the page: 0.08950 seconds