Sql Tour
Tuesday, December 4, 2012
Getting duplicate records with count
SELECT Type, count(*) as TotalCount FROM tblAgentTran
where kcode='4' group by type
having count(
) > 1 order by COUNT(
) DESC
Monday, December 3, 2012
latest / Min /Max Value Group wise
select f.Kcode, f.RunningBalanc
e
from (
select Kcode,max(creat
eddatetime) as latestdate
from tblAgentTran
group by Kcode
) as x inner join tblAgentTran as f on f.Kcode = x.Kcode and f.createddateti
me = x.latestdate;
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)