Only show 5 records

Posted on 2007-08-07
Last Modified: 2013-11-05
My below query works good, but I only want to show the FIRST 5 records otherwise it will display hundreds that I don't want because I am just trying to HIGHLIGHT the latest records.  I know there has got to be an easy way to do this, so I just thought I would ask.

SELECT * FROM cs_ClassifiedsItem WHERE ModuleID = '495' ORDER BY CreatedDate Desc
Question by:chrisryhal
    LVL 11

    Accepted Solution

    SELECT TOP 5 * FROM cs_ClassifiedsItem WHERE ModuleID = '495' ORDER BY CreatedDate Desc
    LVL 75

    Assisted Solution

    by:Aneesh Retnakaran
    SELECT top 5 * FROM cs_ClassifiedsItem WHERE ModuleID = '495' ORDER BY CreatedDate Desc

    LVL 11

    Expert Comment

    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    may be u got some better internet connection
    LVL 17

    Expert Comment

    by:Shanmuga Sundaram
    Hi chrisryhal,

    Hope that you got your results. This is the only way (what the above members have said) that you can achieve your results .
    d.Shanmuga sundaram.
    LVL 2

    Author Comment

    I split the points since you both came in almost the same time :)

    Thanks again, I knew it had to be something easy

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now