SELECT
city + ', ' + state + ' ' + zip AS [output]
FROM address
output
------
Charlotte, NC 28222
Kannapolis, NC 28081
Beverly Hills, CA 90210
SELECT
productName
, quantitySold
, price
, quantitySold * price AS subTotal
FROM sales
prodctName quantitySold price subtotal
---------- ------------ ----- --------
pen 1 .99 .99
paper 25 1.00 25.00
You can use any mathematical operator (not just multiplication). Basically any time you compute a column, the query will look like a formula, keep that in mind, and this will be a breeze!
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)