Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Adding Columns

Author  Topic 

mdixon44
Starting Member

26 Posts

Posted - 2009-01-13 : 13:11:02
Using the L_Foods table, write a query that will display a new column called "New_price" for those rows that have "er" in their description field or "re" in the 2nd and 3rd position of their description field. The New_price column is created by adding 10% to the price_increase field and then adding that to the Price field. Also, combine supplier_id and product_code columns with an underscore (_) between them to create a new column called Supplier_product_code in the output.

HOW in the world to I start?? (HELP!!!!!)

Any Suggestions anyone

Kumar_Anil
Yak Posting Veteran

68 Posts

Posted - 2009-01-13 : 13:25:57
Try this...

select
New_Price = Price + (Price_Increase)*0.1, Supplier_Product_Code = Supplier_id + '_' + Product_code
from L_foods
where
description like '%er' or
substring(description, 2 ,3) like '%re%'
Go to Top of Page

revdnrdy
Posting Yak Master

220 Posts

Posted - 2009-01-13 : 13:41:23
lol, why do these seem like homework questions to me?


r&r
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-13 : 23:41:00
Please note that you're not gaining anything by posting homework questions without trying yourself. At least make a try and then post when you face any problem
Go to Top of Page
   

- Advertisement -