You cannot use the select keyword to load data from a resident table, but need to use the load keyword instead. That also means that the sql join construct cannot be used. In a Qlikview join it's not possible to specify the fields that should be used for the join. Instead the join uses the fields that have the same names in both tables.
excuse me, I had a error in the examples
That way you can make a query using resident tables and SQL tables?
SQL select Id_doc, date_doc, amount_doc, id_customer, id_country
SQL select id_country, name_country
SQL select ctes.id_customer, name_customer, amount_doc, date_doc
from CXC_customer ctes
inner keep resident CXC_Historico his on ctes.id_customer = his.id_customer;
from CXC_Historico h inner keep resident MG_country c on h.id_country = c.id_country;
These queries are examples only, using residents tables.