>In this statement : "select * from db where cnum = 'c'".
>
>I want that query return only one record and the query stop after find one record. I don't want that the query scan all the database for it.
>
SELECT * FROM db WHERE cnum =
bletch GROUP BY cnum
You're going to run into some confusion if any field is not duplicated across all records where you match; it'll take the first value, and you have no assurance of exactly which record will be selected from the set of possible matches. You could add computed fields to the SQL select to tell you how many records actually did match, take sums, whatever. If you always want the first record and there's an index on cnum, you could position to it withouyt neding a SELECT:
SELECT db
LOCATE FOR cnum = "c"
IF FOUND()
ELSE
ENDIF
>What I can append to this query to do it?