ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Create Table w/Identity Column

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create Table w/Identity Column

    I build a seniority table for our HR department and I would like to include the ranking in the table. It currently looks like this:

    Tom 1986-10-23 20 years 0 months 0 days
    @#%@#%@#%@#% 1996-10-23 10 years 0 months 0 days
    Harry 2006-10-23 0 yeart 0 months 0 days

    Is it possible to add in the ranking when creating the table using using a CREATE TABLE AS ( SELECT name, hired, etc........) WITH DATA;
    i.e.:

    1 Tom 1986-10-23 20 years 0 months 0 days
    2 @#%@#%@#%@#% 1996-10-23 10 years 0 months 0 days
    3 Harry 2006-10-23 0 yeart 0 months 0 days

    I know I can create the table first with an identity column and then load the data, but I would like to just add the column to my existing SQL without any more gyrations than I need.

    Pete

  • #2
    Re: Create Table w/Identity Column

    Dont think you can do it that way. I think you will have to do it your other way.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment

    Working...
    X