Robb Hill
asked on
Compare a column in results by values left of decimal
I have the following query:
THE Csitename column can have data like this:
10137.0
10137.1
10137.2
10137.3
10138.0
10139.0
10140.0
10141.0
10142.0
10143.0
10145.0
10146.0
10147.0
What I need to do is the following:
I need to only display the results of this query where the values from this column are duplicates based on comparing the values left of the decimal. Do not assume 5 digits to the left and 1 to the right...only use the decimal as the logic as the lenghts are a varible.
Please help.
select s.cSiteCode, s.cSiteName, c.cFEIN,c.cName,c.cType,s.cPSiteCode
from Site s
INNER JOIN CrmClient sc ON s.nid = sc.nidSite
INNER JOIN Client c ON sc.nIdClient = c.nid
Group by s.cSiteCode,s.cSiteName,c.cFEIN,c.cNAME,c.cType,s.cPSiteCode
THE Csitename column can have data like this:
10137.0
10137.1
10137.2
10137.3
10138.0
10139.0
10140.0
10141.0
10142.0
10143.0
10145.0
10146.0
10147.0
What I need to do is the following:
I need to only display the results of this query where the values from this column are duplicates based on comparing the values left of the decimal. Do not assume 5 digits to the left and 1 to the right...only use the decimal as the logic as the lenghts are a varible.
Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER