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.
| Author |
Topic |
|
satish.gorijala
Posting Yak Master
182 Posts |
Posted - 2009-02-03 : 00:35:16
|
| col1 col2 col34 56 7Can we get col3 as 4/5*100, 6/7*100?I need col3 as Percentage value of col1 & col2?Can we have direct query to do this, if the table contains...lakhs of records?G. Satish |
|
|
thiyagu_rind
Starting Member
46 Posts |
Posted - 2009-02-03 : 00:48:18
|
| hisomething like this.SELECT col1,col2,col1/col2*100 as percentage from tablenameorwe can add a constraints for the col3 with the help of ALTER statement.RegardsThiyagarajan |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-03 : 01:01:13
|
| update tset col3 = col1/col2*100 from tablename t |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-03 : 09:26:43
|
quote: Originally posted by bklr update tset col3 = col1/col2*100.0 from tablename t
small modification |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|