Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Problems with SQL

Problems with SQL

Scheduled Pinned Locked Moved Database
databasehelplearning
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Britney S Morales
    wrote on last edited by
    #1

    Im looking for a query who get result in packages let me explain select * from users where codgroup = 1 i get all the user belongs to group 1 (100 users) i want a query who get the rows by packages ( 10 by 10 users). I hope you can help me PD: Only sql statements, not using paging gridview property

    keep Learning and you never will be out of date...

    C F E 3 Replies Last reply
    0
    • B Britney S Morales

      Im looking for a query who get result in packages let me explain select * from users where codgroup = 1 i get all the user belongs to group 1 (100 users) i want a query who get the rows by packages ( 10 by 10 users). I hope you can help me PD: Only sql statements, not using paging gridview property

      keep Learning and you never will be out of date...

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Britney S. Morales wrote:

      i want a query who get the rows by packages

      I don't understand what you mean by "packages" Do you mean you only want the SQL to return 10 rows at a time?


      Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      1 Reply Last reply
      0
      • B Britney S Morales

        Im looking for a query who get result in packages let me explain select * from users where codgroup = 1 i get all the user belongs to group 1 (100 users) i want a query who get the rows by packages ( 10 by 10 users). I hope you can help me PD: Only sql statements, not using paging gridview property

        keep Learning and you never will be out of date...

        F Offline
        F Offline
        Frank Kerrigan
        wrote on last edited by
        #3

        Britney S. Morales wrote:

        i want a query who get the rows by packages ( 10 by 10 users). PD: Only sql statements, not using paging gridview property

        What's a package ? : (stupid answers on a postcard please )


        Blog Have I http:\\www.frankkerrigan.com

        1 Reply Last reply
        0
        • B Britney S Morales

          Im looking for a query who get result in packages let me explain select * from users where codgroup = 1 i get all the user belongs to group 1 (100 users) i want a query who get the rows by packages ( 10 by 10 users). I hope you can help me PD: Only sql statements, not using paging gridview property

          keep Learning and you never will be out of date...

          E Offline
          E Offline
          Eric Dahlvang
          wrote on last edited by
          #4

          I am guessing that you want something like this:

          select TOP 10 * from users where codgroup = 1  AND usersortfield > 'last groups greatest value' ORDER BY usersortfield

          EXAMPLE: If you were ordering by LastName, you would do this to get the first 10:

          select TOP 10 * from users where codgroup = 1  
          

          Then, when you want the next 10, you would take the lastname from the last record in the previous 10 and:

          select TOP 10 * from users where codgroup = 1  
          

          (Of course, you wouldn't use LastName alone, because it isn't unique enough...but you can see what I mean by this example.)

          --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

          B 1 Reply Last reply
          0
          • E Eric Dahlvang

            I am guessing that you want something like this:

            select TOP 10 * from users where codgroup = 1  AND usersortfield > 'last groups greatest value' ORDER BY usersortfield

            EXAMPLE: If you were ordering by LastName, you would do this to get the first 10:

            select TOP 10 * from users where codgroup = 1  
            

            Then, when you want the next 10, you would take the lastname from the last record in the previous 10 and:

            select TOP 10 * from users where codgroup = 1  
            

            (Of course, you wouldn't use LastName alone, because it isn't unique enough...but you can see what I mean by this example.)

            --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

            B Offline
            B Offline
            Britney S Morales
            wrote on last edited by
            #5

            Eric thats the point, it isnt the answer, but your post given to me a light in the dark, (its just a sentence) :laugh:

            keep Learning and you never will be out of date...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups