找了7个sql不容易写出来的场景,大家看看自己是否可以轻松写出来,也看看新的spl是怎么写的
1、 列出中文人口和英文人口均达到 1% 的国家代码
MySQL8:
select countrycode from world.countrylanguage
where language in ('Chinese', 'English') and percentage>=1
group by countrycode
having count(*)>=2;
集算器SPL:
A |
|
1 |
=connect("mysql") |
2 |
=A1.query@x("select * from world.countrylanguage where percentage>=1") |
3 |
=A2.group(CountryCode) |
4 |
=A3.select(~.(Language).contain("Chinese","English")) |
5 |
=A4.(CountryCode) |
A4: 选取语言包含 Chinese 和 English 的组