Displaying Data from ID's randomly

  • Hey guys, I am working on building a classified ad site and would like to have a web user control that randomly displays posts like a "featured items" widget.

    So with that said I am trying to figure out the best way to quickly iterate through all of the ID's in the postings table and pick say 15 or so ID's at random based on the range of returned PostingID.

    So if I have 300 records in the Postings Table, which the posting ID is an Identity so they will not be contiguous. I can randomly grab some.

  • use "order by newid()"



    Clear Sky SQL
    My Blog[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply