1
GOAL
I’m holding an accountant in the host name column for every customer equal to BRASILFOODS, the only thing I wanted, was for next to the count to appear the name BRASILFOODS
QUERY
SELECT COUNT(*) hostname, customer
FROM tb_get_gap
LEFT JOIN tb_get_customers
ON tb_get_gap.customer = tb_get_customers.cust_cmdb WHERE tb_get_customers.customer = 'BRASILFOODS' and tb_get_gap.exception = 'NO';
OUTPUT
>[Error] Script lines: 1-4 --------------------------
ERROR: column reference "customer" is ambiguous
Line: 1
Apparently there are columns with the same name in their tables. Prefix with the table to which the field refers, as you have already done in your ON clause.
– anonimo