Generated Column - Calculate the number of Data Objects from a column?

Is it possible to create a new column inside a database table, where we could automatically generate a value from data objects of another relational column? For example let’s say that we have a table, named POSTS. It has a relational column ‘LIKES’ referencing all users that liked the POST. Now am I able to use a generated column to calculate the number of users who liked that post automatically?

Hello, @Stefan_Jovanovic,

Unfortunately, only columns from a table, to which generated column is added, can be used in generated column expressions.
For your case, I would suggest using the aggregation function Count.

Regards,
Stanislaw

1 Like

Thanks, I figured it out!