题目如下:
这道题主要考联合查询。
Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.
Note: CITY.CountryCode and COUNTRY.Code are matching key columns.
Input Format
答案如下:
SELECT SON,PARENT ,c.p FROM (SELECT A.N as son ,B.N as parent FROM BST A RIGHT JOIN BST B on A.P=B.N)
tmp join BST C ON tmp.parent =c.n