Welcome to Dream.In.Code
Getting Help is Easy!

Join 117,543 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,704 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Multiplication

 
Reply to this topicStart new topic

Multiplication, need to multiply two columns and return the value to a third one

Rating  1
blueletter
post 9 May, 2008 - 12:50 PM
Post #1


New D.I.C Head

*
Joined: 28 Nov, 2005
Posts: 22


My Contributions


At work they have me working on a database. I have it all done except for a the last stored procedure. I need to be able to multiply to columns in the same table then returning that value to a third column. I am having trouble thinking of how to pull two values then returning the product to another field. I know there is no direct way to multiply values so there has to be a workaround that I have not thought of. I know its got to be simple but I cant seem to grasp the idea of simple procedures over the difficult ones. If you could give me a source or a outline of what the code will look like that would be much appreciated.
User is offlineProfile CardPM

Go to the top of the page


baavgai
post 9 May, 2008 - 01:29 PM
Post #2


Dreaming Coder

Group Icon
Joined: 16 Oct, 2007
Posts: 1,763



Thanked 70 times

Dream Kudos: 400

Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions


I usually would lead you on and try to let you figure it out, but this one's too short not to be a gimme.

CODE

select col1, col2, col1*col2 as col3
   from table


Is this what you're looking for or am I missing something?

This post has been edited by baavgai: 9 May, 2008 - 01:29 PM
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 05:51PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month