missing your country table columns, but the failure is because you have two tables listed... your countries, and your (select/union), but no comma between them or JOIN condition. As for your countries table not listing fields, I'm sure you are looking for the nation's name, but have "nname" in the student's table and don't know if that is correct or not from my perception. Anyhow, you could get the output of your query as below.
select ;
allStNat.Nation as CountryID,;
allStNat.nname,;
allStNat.NationSort ;
from ;
( SELECT nname, ;
nation1id as Nation, ;
1 as NationSort;
FROM students ;
WHERE nation1id > 0;
UNION ALL;
select nname, ;
nation2id as Nation,;
2 as NationSort;
FROM students ;
WHERE nation2id > 0;
UNION ALL;
select nname, ;
nation3id as Nation,;
3 as NationSort ;
FROM students ;
WHERE nation3id > 0 ) allStNat;
order by ;
1, 3, 2
If there was other content from the countries table you wanted, I would alter only slightly by adding the actual country's name and adjusting the order by clause since there is an additional column in the list.
select ;
allStNat.Nation as CountryID,;
c.Country,;
allStNat.nname,;
allStNat.NationSort ;
from ;
( same select/union query above ) allStNat;
JOIN Countries c ;
ON allStNat.Nation = c.id
order by ;
1, 4, 3