65
Views
2
Comments
How to calculate Subtraction in sql
Question

Hi everyone 

I am not SQL expert, Let me ask some question.

I have 3 count value (eg count_A, count_B and count_C)

I want to calculate the value of D.

Is it possible to calculate D = count_A - count_B - count_C in sql.

( in sql maybe count_A - count_B - count_C as D)

How can I achieve this .Please help me .

Thanks

2020-06-08 06-48-23
Divyanshu Pathak

Hi May,

You can use select statement first to fetch the data and then subtract it and fetch your other data. This link might help.

https://stackoverflow.com/questions/6715095/how-to-sum-and-subtract-using-sql

Thanks

Divyanshu

2024-06-19 07-19-32
JitendraYadav

Hi,


SQL Arithmetic Operators works similarly with Advanced SQL widget,


1. Create a specific OutPut structure to get output from advanced SQL.

2. Use advanced SQL widget and write a query accordingly with the help of below link

https://www.w3resource.com/sql/arithmetic-operators/sql-arithmetic-operators.php


Please let us know.


Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.