Question: I'm not clear about below queries and curious to know what is the different between them even though both retrieves same results. (Database used sports2000).

FOR EACH Customer WHERE State = "NH",  

 FIRST Order OF Customer:  

 DISPLAY Customer.Cust-Num NAME Order-Num Order-Date.  

END. 

FOR EACH Customer WHERE State = "NH":  

 FIND FIRST Order OF Customer NO-ERROR.  

 IF AVAILABLE Order THEN  

 DISPLAY Customer.Cust-Num NAME Order-Num Order-Date.
END. 

Please explain me

Regards
Suga

Answer: 
As AquaAlex says your first snippet is a join (the "," part of the syntax makes it a join) and has all of the pros and cons he mentions. There is, however, a significant additional "con" -- the join is being made with FIRST and FOR ... FIRST should never be used.

[FOR LAST - Query, giving wrong result](https://stackoverflow.com/questions/14234893/for-last-query-giving-wrong-result/14235708#14235708)

It will eventually bite you in the butt.

FIND FIRST is not much better.

The fundamental problem with both statements is that they imply that there is an order which your desired record is the FIRST instance of. But no part of the statement specifies that order. So in the event that there is more than one record that satisfies the query you have no idea which record you will actually get. That might be ok if the only reason that you are doing this is to probe to see if there is one or more records and you have no intention of actually using the record buffer. But if that is the case then CAN-FIND() would be a better statement to be using.

There is a myth that FIND FIRST is supposedly faster. If you believe this, or know someone who does, I urge you to test it. It is not true. It is true that in the case where FIND returns a large set of records adding FIRST is faster -- but that is not apples to apples. That is throwing away the bushel after randomly grabbing an apple. And if you code like that your apple now has magical properties which will lead to impossible to cure bugs.

OF is also problematic. OF implies a WHERE clause based on the compiler guessing that fields with the same name in both tables and which are part of a unique index can be used to join the tables. That may seem reasonable, and perhaps it is, but it obscures the code and makes the maintenance programmer's job much more difficult. It makes a good demo but should never be used in real life.
Your first statement is a join statement, which means less network traffic. And you will only receive records where both the customer and order record exist so do not need to do any further checks. (MORE EFFICIENT)

The second statement will retrieve each customer and then for each customer found it will do a find on order. Because there may not be an order you need to do an additional statement (If Available) as well. This is a less efficient way to retrieve the records and will result in much more unwanted network traffic and more statements being executed.