Loading ...
Sorry, an error occurred while loading the content.

[SQLQueriesNoCode] index with query to fetch prev/next

Expand Messages
  • Cosmo Kramer
    Query#1 ... table#1 id catID subID username tableCats catID sortOrder name tableSubCats subID sortOrder name I need to sort the above table by category
    Message 1 of 1 , Mar 7, 2003
    • 0 Attachment
      Query#1
      ---------------------

      table#1

      id catID subID username


      tableCats

      catID sortOrder name

      tableSubCats

      subID sortOrder name




      I need to sort the above table by category (ordered by sortOrder), then by
      subcategories inside the categories (ordered by sortOrder).

      e.g.
      SomeCategory
      someSubCategory
      username
      username
      someSubCategory2
      username
      username
      ..
      ..



      Query#2
      ---------------------

      This query will return the 'previous' and 'next' username given a username.
      The 'prev' and 'next' username will be from the query above (i.e the users
      will be sorted according to category,subcategory using their sortorders).
      If there is no next username it will get the 1st user (i.e start from the
      top) and if to previous it will start from the bottom etc. -- so its a
      continous loop.



      _________________________________________________________________
      The new MSN 8: smart spam protection and 2 months FREE*
      http://join.msn.com/?page=features/junkmail
    Your message has been successfully submitted and would be delivered to recipients shortly.