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)
 selecting only first record in group

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-24 : 08:48:59
Ray writes "I have a table that contains one record for each time a medical claim is generated to a specific insurance company (medical claim billing system).

A claim can be sent out more than once to different bill types and/or Insurance companies. The data I need to select is the ChargeControl (a pointer to the specific charge that generated a claim), BillType (is a super-category of insurance company (ie Blue Cross/Blue Shield), and InsCo (ie Blue Cross/Blue Shield of Ohio). The key column is the ChargeControl. I need to be able to select the first record for each ChargeControl in the table.

Example:

Charge Control     BillType   InsCo
12345 10 120
12345 10 230
12345 52 295
23456 13 792
23456 55 222
34567 15 150


I want to grab just the first record of each of the Charge Controls.

How can I do this in SQL?

Thanks in advance."
   

- Advertisement -