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