在所有行中获得相同的值

时间:2018-01-05 16:03:28

标签: postgresql

有人可以告诉我我在查询时遇到了什么问题。

select cr.name, count ( p.user_id) from profiles_profile p
inner join profiles_contact pc on p.contact_id = pc.id
inner join location_address la on pc.address_id = la.id 
inner join cities_country cc on la.country_id = cc.id
inner join cities_region cr on cc.id = cr.country_id
where p.approve_status = 'approved'
and p.user_class = 'user'
and cc."name" like 'Germany'
group by cr.name

请查看使用此查询输出的屏幕截图。 enter image description here

0 个答案:

没有答案