SQL 2000, some functions from client side not work

2019-07-28 06:03发布

问题:

I create a query:

Select * from HR_Tsalary where month='3' and year ='2010'

the result is 473 records and I found 2 duplicate record, then I create another query to find duplicate record only:

SELECT Emp_No, COUNT(*) FROM HR_Tsalary
WHERE year = '10' AND month = '3'
GROUP BY  Emp_No HAVING COUNT(*) > 1

the result is zero record from client side thru Visual Basic Adodb code. When I use same query from server the result is 2 records. Is there any different between when create a query from server side and client side?

回答1:

Your second query filters on YEAR='10' whereas the first one filters on YEAR='2010'. That's probably the cause. Are you sure you're running the exact same query on both ends?