473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Performing mathematical operations on Table columns

Hello Guys,

I am new to SQL Server Database programming.

My specific question is:- Is it possible to do some mathematical operations on columns present in a table. If possible, How?

For example, how can the following operation be performed:-
(25*Column3) - (2*Column1)

Please kindly let me know

Many thanks,
Ramesh
Nov 27 '06 #1
2 3581
sashi
1,754 Expert 1GB
Hello Guys,

I am new to SQL Server Database programming.

My specific question is:- Is it possible to do some mathematical operations on columns present in a table. If possible, How?

For example, how can the following operation be performed:-
(25*Column3) - (2*Column1)

Please kindly let me know

Many thanks,
Ramesh
Hi there,

Did you mean "columns" or "data in columns"? Which one? I doubt you can you can perform mathematical operations on "columns". Lets see what other experts have to say. Good luck & Take care.
Nov 27 '06 #2
iburyak
1,017 Expert 512MB
You just wrote as it supposed to be.
Only thing is make sure datatypes in all columns are numeric if not converted to int before math operations.
Example:
select (2 * cast(column1 as int)) from tablename
Nov 28 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Eric Wichterich | last post by:
Hello Pythonistas, I use Python shelves to store results from MySQL-Queries (using Python for web scripting). One script searches the MySQL-database and stores the result, the next script reads...
3
by: Paul van Hagen | last post by:
Hello, I've been doing some research as to ways to optimise our parsing and evaluation of mathematical expressions and came across the spirit template library as part of the boost library. It...
2
by: Zorpiedoman | last post by:
If I have a string, "(5+3)/8" or "23>9" Has .NET provides some sort of parser that can get me the mathematical answer? Years ago, in VB6 I found an answer to this question using some sort of...
3
by: Alexander Pucher | last post by:
Hi, given a table with some data, e.g. some monthly measures. Some of the measures are missing though. id m1 m2 m3 m4 m5 .... m12...
9
by: tomamil | last post by:
imagine that you have different matrices with different names and you want to perform the same action with each of them. is it possible to put their names into some array and to create a loop that...
5
w33nie
by: w33nie | last post by:
My table is pretty well complete, but I would prefer it if the value for Points could be turned into a mathematical equation, and this equation would use the data from the other fields in the table...
3
by: vasilip | last post by:
I noticed that DB2 does not support bitwise operations but I found some UDFs that seem to give this functionality.. There seems to be a consensus that bitoperations are not usefull (or bad...
2
by: Madmartigan | last post by:
Hi Operating system is WinXP using SharpDevelop version 1.1.0 and build 2124. I'm new to C# and have a problem trying to get a user to enter 3 mathematical operators of choice, then 2 numbers...
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.