Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Add custom row when using select query

So I have a table with name, quantity and price

name        quantity        price        "custom-row"
a           12              5             12*5
b           20              3             20*3
c           18              10            18*10

Is it possible to add a "custom" row when using a select query? And I want the values in that row = quantity * price. How can I do that?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

select name, quantity, price, (quantity * price) as custom_row
from table_name

you can just multiply your columns by column name and after AS sign any column name you want

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading