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
  1. Home
  2. General Programming
  3. C#
  4. how to write the query to select 10 record from database

how to write the query to select 10 record from database

Scheduled Pinned Locked Moved C#
databasetutorial
6 Posts 3 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.
  • R Offline
    R Offline
    Rmesh
    wrote on last edited by
    #1

    how to write the query to select 10 record from database

    N S 2 Replies Last reply
    0
    • R Rmesh

      how to write the query to select 10 record from database

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Depends where the 10 records are. SELECT TOP 10 will get the first ten records matching the criteria. If you want 10 records in teh middle or end then you have more work to do.


      only two letters away from being an asset

      1 Reply Last reply
      0
      • R Rmesh

        how to write the query to select 10 record from database

        S Offline
        S Offline
        sanjaybs2001
        wrote on last edited by
        #3

        Select top 10 * from

        R 1 Reply Last reply
        0
        • S sanjaybs2001

          Select top 10 * from

          R Offline
          R Offline
          Rmesh
          wrote on last edited by
          #4

          ok how to get next 10 records from table ?how to write query to get it

          S 2 Replies Last reply
          0
          • R Rmesh

            ok how to get next 10 records from table ?how to write query to get it

            S Offline
            S Offline
            sanjaybs2001
            wrote on last edited by
            #5

            You need to retrive 20 records and ignore top 10 to get next 10 records

            1 Reply Last reply
            0
            • R Rmesh

              ok how to get next 10 records from table ?how to write query to get it

              S Offline
              S Offline
              sanjaybs2001
              wrote on last edited by
              #6

              or Select top 10 * from agent where agentid not in (select top 10 agentid from agent)

              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