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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-07 : 07:10:28
|
| Steve writes "I need a query to show all the medicare patients only. I want only one kind of insurance for each patient. I am getting records where each patient has more than one insurance like medicare and something else.Each patient has one,two, three or more insurances like medicare,medical,blue cross,tricare etc. The result should look like this:Sam pick MedicareJohn white MedicareAnn Richmond Medicare My query retrieves patients with more than one insurance.select patient_first_name f_name,patient_last_name l_name,patient_zip zip, count(distinct payer_id) payer_id from claims where payer_id ='abcdefhj' group by patient_first_name, patient_last_name,patient_zip having count(distinct payer_id)= 1 order by patient_zip asc;please help me. Greatly appreciate your response." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|