Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    14

    Unanswered: how to sort and return first few tuples.

    Hi,

    I have a table with 3 attributes, id (primary key, int), tag and count... i need to return first 50 tags, after sorting the tags by count in descending order (to choose the first 50 most popular tags).. I need to create a function for this. I am thinkin of creating a temperory table to store sorted tags, and then select the first 50 frm the new table...but i m not sure how to select top few tuples.... is there sum way to have a counter within the loop that is used to return values?
    I m not sure how to this in postgreSQL...so i wuld really appreciate it if sumone culd help with this..thnx.

  2. #2
    Join Date
    May 2006
    Posts
    14
    Nvrmind... i used "limit" n it works...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •