motioneye
asked on
T-sql query to count same value > 1
select * from vNameEmp where personal='078922251'
a query above return me 3 rows which 2 of the rows has white space at the end '078922251 '
But when I query to search how many are duplicate in vNameEmp, the query below result me empty.
select company,id,count(personal) as personaloQty
from vNameEmp
--where userid=94
group by company,Id,personal having count(*)>1
and I'm trying with trim but did not get success.
select rtrim(ltrim(personal_no)), company,id ,count(per sonal) as personaloQty
from vNameEmp
--where userid=94
group by company,Id,personal having count(*)>1
anyone can help me to build this query ?
a query above return me 3 rows which 2 of the rows has white space at the end '078922251 '
But when I query to search how many are duplicate in vNameEmp, the query below result me empty.
select company,id,count(personal)
from vNameEmp
--where userid=94
group by company,Id,personal having count(*)>1
and I'm trying with trim but did not get success.
select rtrim(ltrim(personal_no)),
from vNameEmp
--where userid=94
group by company,Id,personal having count(*)>1
anyone can help me to build this query ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER