The following join attempts to join Travel-Sample and Beer-Sample by a non-key field "country.
Select b.country COUNTRY, b.name BREWERY, a.name AIRLINE From `travel-sample` a Join `beer-sample` b On Keys (a.country) Order By a.country, b.name;
While the query is processed it returns a null result string, which is incorrect.
The discussion of the “On Keys” clause with respect to its use in joins does state that the key being referenced should be the primary key of the table being joined, so I understand that this query will not work in its present form. My question: Is there any way in N1QL to execute this join correctly?
btw: I’m trying to catalog all of the places where N1QL is different from SQL, and in fact the above join could be successfully executed in generic SQL.