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 |
|
dgsd_in
Starting Member
1 Post |
Posted - 2008-01-24 : 01:44:24
|
| HiI am new to sql forums. I am just confused to create a query.I have a sales table that contains sum of sold items and also another column that contains no. of cancelled items after sale. Now i have to get the sum of all those items which are soled after deducting the cancelled items amount. Can somebody help me in this regard.Thanks & RegardsRavi |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-01-24 : 01:53:37
|
| Try thisdeclare @table table( sold int, cancel int)insert into @Tableselect 25,5 union allselect 35,3select sold-cancel [Total Sale] from @TableAlso, post proper DDL and required result in future to get best help.Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
|
|
|