?
Solved

sequence number in db2

Posted on 2001-08-23
4
Medium Priority
?
1,453 Views
Last Modified: 2009-12-09
How can I create a sequence number like x=x+1 directly in select statement in db2.
Sample SELECT x=x+1 || oid FROM tablename.
0
Comment
Question by:hj
[X]
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
4 Comments
 

Expert Comment

by:hitachi
ID: 6431359
Hi
   Can you please elaborate more on what you want.
I guess if you want the sequence functionality then
there is facility of auto genration of numbers in db2.
For that you have to crate a table with a field which is
populated by db2 itself. You can find detail about on db2
manuals.
          If you want row number like functionality then
you can use ROW_NUMBER() function.




Hitachi
0
 

Author Comment

by:hj
ID: 6433615
I'm trying to create a view on existing tables. All these tables contains a column OID (because the application above is object oriented). I wanna combine all the OID's in one column in the view and exactly for this I need an additional sequence number.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7259728

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 

Accepted Solution

by:
Jgould earned 0 total points
ID: 7289416
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
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…

801 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