Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SQL question

Status
Not open for further replies.

emmaUK

Programmer
Jan 23, 2006
10
GB
Please help me guys i'm a complete SQL noob!

I have a table where one of the columns is a DECIMAL(15, 4)

How do I divide all the numbers in this column by 2.0?

Cheers Emma :)
 
If you want to update the values in the table:
[tt]
UPDATE tblname SET fldname=fldname/2
[/tt]
If you want to leave the table as is, but retrieve the values divided by 2:
[tt]
SELECT fldname/2 fld_2 FROM tblname
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top