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. Stored Procedure

Stored Procedure

Scheduled Pinned Locked Moved C#
databasequestion
5 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.
  • 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

    L M 2 Replies 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

      L Offline
      L Offline
      Le centriste
      wrote on last edited by
      #2

      Wrong forum.

      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
        Member 1033907
        wrote on last edited by
        #3

        It's going to be something like SELECT objectName, MIN(objectDateInserted) FROM yourTable GROUP BY objectName where objectName is the column containing 'object1', 'object2' etc. and objectDateInsert is the column containing insertion dates of the individual records. MIN selects the first insertion. Others will correct me. But yeah, it is a wrong forum. H.

        K 1 Reply Last reply
        0
        • M Member 1033907

          It's going to be something like SELECT objectName, MIN(objectDateInserted) FROM yourTable GROUP BY objectName where objectName is the column containing 'object1', 'object2' etc. and objectDateInsert is the column containing insertion dates of the individual records. MIN selects the first insertion. Others will correct me. But yeah, it is a wrong forum. H.

          K Offline
          K Offline
          kibromg
          wrote on last edited by
          #4

          Many thanks for your response.Its Much appreciated. The problem i have is there is another column in my select statement. SELECT objectName, MIN(objectDateInserted),SO_Name FROM yourTable GROUP BY objectName Then It gives me to diffrent entry for diffrent SO_name for the same object1. However ,what i want is the minimum of the three all those in Time. Please advice Thank you once again.

          M 1 Reply Last reply
          0
          • K kibromg

            Many thanks for your response.Its Much appreciated. The problem i have is there is another column in my select statement. SELECT objectName, MIN(objectDateInserted),SO_Name FROM yourTable GROUP BY objectName Then It gives me to diffrent entry for diffrent SO_name for the same object1. However ,what i want is the minimum of the three all those in Time. Please advice Thank you once again.

            M Offline
            M Offline
            Member 1033907
            wrote on last edited by
            #5

            I understand what you mean but unfortunatelly - I don't know. It doesn't seem like a difficult problem so maybe if you try your luck in some SQL/Database forum, you'll get the answer. I'm really not much of a database expert. Sorry, H.

            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