In Excel we can create reference cell (e.g. A2 = A1 + 1). Or we create a reference cell on other sheet.
On postgres I would like create a reference cell to another table. Is it possible? How could I achieve that?
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
RDBMS uses a different approach. There are queries and data. When you query something, it is natural to perform extra calculations on the data. In your case this is a simple arythmetic function.
Say, you have a table:
Now, to achieve your case you can do the following:
As you can see, I’m using existing columns in the formula and assign the result a new alias
a2.I really recommend you to read the Tutorial and SQL Basics from the official PostgreSQL documentation, along with some SQL introduction book.