Answer the question
In order to leave comments, you need to log in
How to write a query in sql with a calculated field?
there is entity A { id:int, title:string, numplaces:int, freenumplaces:int }
there is entity B { id:int, product:int, tikets:int}
tables are not related
when querying select "id", "title", "numplaces", "freenumplaces" from A
freenumplaces should count as (select Sum(tikets) from B where product= A .id)
Answer the question
In order to leave comments, you need to log in
You can use INSERT INTO to first insert data into this column, and then just SELECT to get everything from the table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question