can you please post the query that you have written so that we can see what you have tried and help you
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/