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 |
usafelix
Posting Yak Master
165 Posts |
Posted - 2015-01-28 : 02:51:51
|
Anyone can help ?I want to output this result. how to write this query? "This is new amount 1000"select "This is new amount "+@sum(amt) as amount from table |
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2015-01-28 : 05:04:23
|
-- Are you trying to add @sum variable to field amt?Declare @num int = 1000Declare @sum int = 1500select @num + @sum as amount from mytable -- or to sum field amt select 1000 + sum(amt) as amount from mytableWe are the creators of our own reality! |
|
|
viggneshwar
Yak Posting Veteran
86 Posts |
Posted - 2015-01-28 : 07:36:47
|
select "This is new amount "+ cast(sum(amt) as varchar(20)) as amount from tableRegardsViggneshwar A |
|
|
|
|
|