>Hi friends
>i need ur advise on this query.I've 2 fields in a table (patient,invoice).
>field invoice contains invoice no for a patient.this no can be duplicated for the same patient but not for the different patient.
>i mean we can have data like this
>
>patient invoice
>pk patient invoice
>1 John I001
>2 John I001
>3 Paul I002
>
>but there should not be like following
>pk patient invoice
>A1 John I001
>A2 John I001
>A3 Paul I001 --its wrong
>A4 Paul I002
>
>my question is how can i find out such duplicates ?
>Thanks
It's two steps but how about.........
SELECT DISTINCT invoice,patient FROM myTable INTO CURSOR curTmp
SELECT invoice FROM curTmp GROUP BY 1 HAVING COUNT(*) > 1