开发者

In SQL, how to multiply data of two columns for third column

开发者 https://www.devze.com 2023-03-16 15:38 出处:网络
I want to multiply the data of two columns and show it in the third column. For example: 1st Column: Quantity

I want to multiply the data of two columns and show it in the third column.

For example:

1st Column: Quantity
2nd Column: Rate
3rd Column: Price

I want to multiply as user enters the data for quantity and rate like Quantity=2, rate=50 automatically in price column I want 100 to be mentioned.

Using C#, VS2010, SQL 2008

Edit: I want to show the data at the DataGridView what are the possible solutions, I used DataAdapter and DataSet to update the开发者_JAVA百科 database:

this.table2TableAdapter.Update(testingDataSet);


SELECT QUANTITY, RATE, QUANTITY*RATE as PRICE
FROM YOUR_TABLE
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号