Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Dear All, How to get the sum of fieldb.[fsize][red] from this code
"select b.[Filename],b.[FilePath],b.[fileid],b.[fsize],b.[modifieddate],a.[softID],a.[softName],a.[displayName],a.[Softpath],a.[type] from wms_mstOld b,mstNew a where a.softid=b.softid and a.softid in" & sSoftwareidlist
Thanks in AdvanceDana
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2007-03-22 : 11:21:02
You use GROUP BY keyword and SUM function.Peter LarssonHelsingborg, Sweden
danasegarane76
Posting Yak Master
242 Posts
Posted - 2007-03-23 : 02:10:01
Dear Peter, I am trying like this.But I am gettting error.Can you please help
select b.[Filename],b.[FilePath],b.[fileid],sum(b.[fize]),count(*),b.[fsize],b.[modifieddate],a.[softID],a.[softName],a.[displayName],a.[Softpath],a.[type] from wms_mstOld b,mstNew a where a.softid=b.softid and a.softid in (1) group by b.[FileName]
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2007-03-23 : 06:52:08
select b.[Filename], sum(b.[fize]),count(*),a.[softName],a.[displayName],from wms_mstOld as binner join mstNew as a on a.softid = b.softid and a.softid = 1group by b.[FileName]Peter LarssonHelsingborg, Sweden