在 AppMaker 中使用计算模型连接两个大表

Joining two large tables using a calculated model in AppMaker

我在 Google AppMaker 中有两个 SQL 数据源。两者都会有数万条记录:

上次登录:

+-------------------+-----------+
|       Email       | LastLogin |
+-------------------+-----------+
| email@domain.com  | 1/1/2019  |
| email2@domain.com | 12/1/2018 |
+-------------------+-----------+

和许可证:

+------------------+---------+------------+
|      Email       |  SkuID  |  SkuName   |
+------------------+---------+------------+
| email@domain.com | 1001001 | Enterprise |
| email2@domain.com| 1001001 | Basic      |
+------------------+---------+------------+

我想加入表以使用以下数据创建计算数据源:

+------------------+---------+------------+-----------+
|      Email       |  SkuID  |  SkuName   | LastLogin |
+------------------+---------+------------+-----------+
| email@email.com  | 1001001 | Enterprise | 1/1/2019  |
| email2@email.com | 1001001 | Basic      | 12/1/2018 |
+------------------+---------+------------+-----------+

我尝试了几个不同的 join 命令,但 none 有效。这是我当前的迭代:

select 
    m.Email,
    m.SkuID,
    m.SkuName,
    l.Email,
    l.LastLogin
from Licenses m ,LastLogins l
full join LastLogins on Licenses.Email = LastLogins.Email

我得到的错误是;

Exception: Malformed SQL. More information: Error with SQL statement: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'full join LastLogins on Licenses.Email = LastLogins.Email LIMIT 26' at line 3.

您快完成了,但是您连接表的语法是错误的。

语法是:

FROM <table1> as <alias1>
INNER JOIN <table2> as <alias2> ON ...

尝试:

select 
    m.Email,
    m.SkuID,
    m.SkuName,
    l.LastLogin
from Licenses as m
inner join LastLogins as l on l.Email = m.Email