Thursday, 27 September 2012

Query with WHERE and HAVING clause together

SELECT distinct(am_cuid) FROM AMCASCCONTRACT WHERE

dateadd(yy,convert(int,am_serviceyr),am_pickdt)>getdate()

group by am_cuid having COUNT(am_cuid) >1

No comments:

Post a Comment