Skip to Content
0
Former Member
Sep 05, 2013 at 12:41 PM

Select query gives different result in DB level

29 Views

HI,

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

FROM COEP

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.

Thanks,

Sudhakaran´╗┐