I am using query given below in hibernate with oracle10g,
"SELECT OcspTransactionLogs.relyingPartyIp,OcspTransactionLogs.relyingPartyId,count(OcspTransactionLogs.id)
FROM OcspTransactionLog OcspTransactionLogs
WHERE OcspTransactionLogs.responseStatus = 'successful'
GROUP BY OcspTransactionLogs.relyingPartyIp,OcspTransactionLogs.relyingPartyId
ORDER BY count(OcspTransactionLogs.id) desc"
It properly grouping records without "order by clause",as I order it by count(...), It fill first record data in "OcspTransactionLogs.relyingPartyIp and OcspTransactionLogs.relyingPartyId" for the subsequent records,
e.g,
True grouping records are as,
192.123.12.13 N/A 10
192.123.12.13 testData 30
But when order by clause is used as in above query, records will be,
192.123.12.13 N/A 30
192.123.12.13 N/A 10
What can I do to get exact records by using order by clause,
Needs your urgent help.
Thanks.
Naeem
|