Is it possible to create a temporary column during a sql query?
Posted on 2015-02-15
If I am joining two tables, is it possible t create a temporary column for a table, strictly for the sake of me doing the sql query? I wouldn't want to make the additional column permanent, as it would only be used for the sake of the query?
For example, below suppose Table_1 has two columns, and Table_2 has three columns. For my query, I would like to create temporary column for table 1 named "StudentId", populate it with an incrementing unique integer starting at 1, and going as high as needed.
I suppose I could use a temp table, however if I could create a temporary column, that would be great.
FirstName LastName StudentId
Jerry Grisselton SocialSSN