Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to get first record

Author  Topic 

Rita Bhatnagar
Posting Yak Master

172 Posts

Posted - 2001-06-13 : 10:33:52
i have a query in access

SELECT WeightRec.CRID, First(WeightRec.Weight) AS FirstWeight
FROM WeightRec
GROUP BY WeightRec.CRID;

and this is the table structure.

Weight
RecID CRID Weight
1 2 180
2 2 185
3 41 115
4 12 200
5 12 191
6 49 195
7 49 194
8 49 194.5
9 49 180

i used this query for sqlserver

SELECT WeightRec.CRID, min(WeightRec.Weight) AS FirstWeight FROM WeightRec GROUP BY WeightRec.CRID

but i need first weight not the min so this query doesn't work.
Any suggestions?


   

- Advertisement -