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
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
Comment