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. Database & SysAdmin
  3. Database
  4. SQL TABLE

SQL TABLE

Scheduled Pinned Locked Moved Database
databasequestion
2 Posts 2 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.
  • K Offline
    K Offline
    kibromg
    wrote on last edited by
    #1

    Hi All , I have 50,000 entries on my Sql 2005 Table.I would like to know the first time each distinct objects gets in to my table. Lets say object1 has 10 records on my table at diffrent date ,object2 gas 100 records on the table,object3 has 500 records in the table registered at different date. I would like to reterive each objects with there first entry only,how would i do it? Please advice. THank you all

    M 1 Reply Last reply
    0
    • K kibromg

      Hi All , I have 50,000 entries on my Sql 2005 Table.I would like to know the first time each distinct objects gets in to my table. Lets say object1 has 10 records on my table at diffrent date ,object2 gas 100 records on the table,object3 has 500 records in the table registered at different date. I would like to reterive each objects with there first entry only,how would i do it? Please advice. THank you all

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Look into rownumber() and partition int TSQL. Combining these to with order by can give you the row numbers of your objects sorted by dates desc and you want rownumber 1 for each object.

      Never underestimate the power of human stupidity RAH

      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