Arithmetic ADD operator


SQL Server Query

            
SELECT  
ProductID,
ProductName,
UnitPrice + (UnitPrice * 0.10) AS NewPrice -- Add 10% to the UnitPrice
FROM Products;

Create SQL query with SqlQueryBuilder

            
var (sql, parameters) = new SqlQueryBuilder()  
.Select()
.Columns("ProductID", "ProductName")
.Column(new ColumnArithmatic("UnitPrice").ADD().StartBracket("UnitPrice").MULTIPLY(0.10).EndBracket()
, "NewPrice")
.From("Products")
.Build();

Query build by SqlQueryBuilder

            
SELECT ProductID,
       ProductName,
       UnitPrice + (UnitPrice * @pMAIN_2507200128177160440) AS NewPrice
FROM Products;


            
        

Parameters (If used)

Name Value
@pMAIN_2507200128177160440 0.1

Query Results:

  ProductID ProductName NewPrice RemainingStock
1 1 Chai 19.8 0
2 2 Chang 20.9 0
3 3 Aniseed Syrup 11 0
4 4 Chef Anton's Cajun Seasoning 24.2 0
5 5 Chef Anton's Gumbo Mix 23.485 0
6 6 Grandma's Boysenberry Spread 27.5 0
7 7 Uncle Bob's Organic Dried Pears 33 0
8 8 Northwoods Cranberry Sauce 44 0
9 9 Mishi Kobe Niku 106.7 0
10 10 Ikura 34.1 0
11 11 Queso Cabrales 23.1 0
12 12 Queso Manchego La Pastora 41.8 0
13 13 Konbu 6.6 0
14 14 Tofu 25.575 0
15 15 Genen Shouyu 17.05 0
16 16 Pavlova 19.195 0
17 17 Alice Mutton 42.9 0
18 18 Carnarvon Tigers 68.75 0
19 19 Teatime Chocolate Biscuits 10.12 0
20 20 Sir Rodney's Marmalade 89.1 0
21 21 Sir Rodney's Scones 11 0
22 22 Gustaf's Knäckebröd 23.1 0
23 23 Tunnbröd 9.9 0
24 24 Guaraná Fantástica 4.95 0
25 25 NuNuCa Nuß-Nougat-Creme 15.4 0
26 26 Gumbär Gummibärchen 34.353 0
27 27 Schoggi Schokolade 48.29 0
28 28 Rössle Sauerkraut 50.16 0
29 29 Thüringer Rostbratwurst 136.169 0
30 30 Nord-Ost Matjeshering 28.479 0
31 31 Gorgonzola Telino 13.75 0
32 32 Mascarpone Fabioli 35.2 0
33 33 Geitost 2.75 0
34 34 Sasquatch Ale 15.4 0
35 35 Steeleye Stout 19.8 0
36 36 Inlagd Sill 20.9 0
37 37 Gravad lax 28.6 0
38 38 Côte de Blaye 289.85 0
39 39 Chartreuse verte 19.8 0
40 40 Boston Crab Meat 20.24 0
41 41 Jack's New England Clam Chowder 10.615 0
42 42 Singaporean Hokkien Fried Mee 15.4 0
43 43 Ipoh Coffee 50.6 0
44 44 Gula Malacca 21.395 0
45 45 Rogede sild 10.45 0
46 46 Spegesild 13.2 0
47 47 Zaanse koeken 10.45 0
48 48 Chocolade 14.025 0
49 49 Maxilaku 22 0
50 50 Valkoinen suklaa 17.875 0
51 51 Manjimup Dried Apples 58.3 0
52 52 Filo Mix 7.7 0
53 53 Perth Pasties 36.08 0
54 54 Tourtière 8.195 0
55 55 Pâté chinois 26.4 0
56 56 Gnocchi di nonna Alice 41.8 0
57 57 Ravioli Angelo 21.45 0
58 58 Escargots de Bourgogne 14.575 0
59 59 Raclette Courdavault 60.5 0
60 60 Camembert Pierrot 37.4 0
61 61 Sirop d'érable 31.35 0
62 62 Tarte au sucre 54.23 0
63 63 Vegie-spread 48.29 0
64 64 Wimmers gute Semmelknödel 36.575 0
65 65 Louisiana Fiery Hot Pepper Sauce 23.155 0
66 66 Louisiana Hot Spiced Okra 18.7 0
67 67 Laughing Lumberjack Lager 15.4 0
68 68 Scottish Longbreads 13.75 0
69 69 Gudbrandsdalsost 39.6 0
70 70 Outback Lager 16.5 0
71 71 Flotemysost 23.65 0
72 72 Mozzarella di Giovanni 38.28 0
73 73 Röd Kaviar 16.5 0
74 74 Longlife Tofu 11 0
75 75 Rhönbräu Klosterbier 8.525 0
76 76 Lakkalikööri 19.8 0
77 77 Original Frankfurter grüne Soße 14.3 0