I am trying to filter the table on customerId obtained by joining users and registrations.
SELECT "Users"."Customer ID" AS "Customer ID", count(*) AS "count"
FROM "public"."registrations"
LEFT JOIN "public"."users" "Users" ON "public"."registrations"."User ID" = "Users"."ID"
WHERE "public"."registrations"."Show ID" is not null and "Users"."Customer ID" is not null [[and {{date}}]] **[[and {{customer}}]]**
GROUP BY "Users"."Customer ID"
ORDER BY "count" DESC, "Users"."Customer ID" ASC
LIMIT 20
Yes, it was working fine in mysql. I have removed name aliasing but still it does not work. Can you figure it out?
SELECT "Customer ID", count(*) AS "count"
FROM "public"."registrations"
LEFT JOIN "public"."users" ON "public"."registrations"."User ID" = "ID"
WHERE "public"."registrations"."Show ID" is not null and "Customer ID" is not null [[and {{date}}]] [[and {{customer}}]]
GROUP BY "Customer ID"
ORDER BY "count" DESC, "Customer ID" ASC
LIMIT 20