First note the reason I ask the question and hold out hope it is possible.
In MS SQL Server 2016, you have the ability to create a table with a column defined mathematically similar to a row_number() over(order by (select 1)) as oid
via the identity(1,1)
in a table definition.
Which leads to the question...
Is there built in functionality to define a table something like the following? (Yes this is pseudo code people...)
CREATE TABLE Persons (
LastName varchar(255) NOT NULL
FirstName varchar(255),
Age int,
MemberInFamilyID int Row_number() over(partition by LastName order by
Age,FirstName),
);
I know you can just define the column and populate it after the fact, but I'm curious if there is an efficient way to do it on table definition that populates on insert.
My current application is MS SQL Server, but feasibility in any database would be useful information as well. Particularly PostgreSQL.