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 |
anmasula
Starting Member
1 Post |
Posted - 2013-06-24 : 01:35:11
|
Below is the query Im Using,select DISTINCTRTRIM(LTRIM(V_Gs_Processor.Name0)),Count(*) as 'Count' From V_gs_processor Group by Name0But still Im getting duplicate entries... result is as below,Intel(R) Pentium(R) 4 CPU 2.00GHz 3Intel(R) Pentium(R) 4 CPU 2.40GHz 3Intel(R) Pentium(R) 4 CPU 2.40GHz 6Intel(R) Pentium(R) 4 CPU 2.80GHz 1Intel(R) Pentium(R) 4 CPU 2.80GHz 17Intel(R) Pentium(R) 4 CPU 3.00GHz 12Intel(R) Pentium(R) 4 CPU 3.00GHz 101Intel(R) Pentium(R) 4 CPU 3.20GHz 7Intel(R) Pentium(R) 4 CPU 3.20GHz 124Intel(R) Pentium(R) 4 CPU 3.40GHz 1Intel(R) Pentium(R) D CPU 3.40GHz 3Intel(R) Pentium(R) D CPU 3.40GHz 52Can anybody help me please.... :) |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-24 : 01:41:36
|
[code]selectRTRIM(LTRIM(V_Gs_Processor.Name0)),Count(*) as 'Count' From V_gs_processor Group by RTRIM(LTRIM(V_Gs_Processor.Name0))[/code]Name0 value is still distinct which is why it gave you duplicatesyou need to apply same expression on group by------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|