An sql query to get the count of the distinct records gives different output when executed from SAP GUI and from DB(sql server management studio 2008).
SAP GUI :
From SQL command editor ,the follwoing qurey gives the output as "515939"
SELECT count(DISTINCT OBJNR) AS c
WHERE MANDT = '010' AND OBJNR <> 'NV%'
Sql Server Management Studio :
The below query when executed in sql server management studio 2008,gives the result "497411"
select COUNT(DISTINCT OBJNR) from <SID>.COEP where MANDT= '010' and OBJNR NOT LIKE 'NV%'.
Can anyknow help me to know the reason for this.