user485190
user485190

Reputation: 55

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

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 database:

this.table2TableAdapter.Update(testingDataSet);

Upvotes: 2

Views: 12619

Answers (1)

Giann
Giann

Reputation: 3192

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

Upvotes: 9

Related Questions