【发布时间】:2020-06-14 05:57:10
【问题描述】:
我收到一条错误消息,提示输出与给定问题不匹配
萨基拉 DB:https://dev.mysql.com/doc/sakila/en/sakila-structure.html
下面是我的代码
with temp as (
select concat(b.first_name, ' ',b.last_name) as name,
count(a.rental_id >= 1) as rental_count
from rental a
inner join customer b ON (a.customer_id=b.customer_id)
inner join address c ON (b.address_id=c.address_id)
inner join city d ON (c.city_id=d.city_id)
where d.city like "Arlington"
group by name
order by rental_count
)
select name from temp
预期结果是
full names of those customers who have rented at least one movie and belong to the city Arlington.
请告诉我是什么错误或有其他方法吗?
【问题讨论】:
-
在您的数据中,如果某人没有租借任何电影,他们如何成为客户?
标签: mysql sql inner-join