3
I am making a migration from mysql to postgres, but there is an error happening, not much experience with postgres:
SELECT
SELECT m.* , (SELECT c.id
FROM corridas c
WHERE c.motoqueiro = m.id
AND (c.status = 0 OR c.status = 1)) as total
FROM motoqueiros m
WHERE now() - INTERVAL '17888 SECONDS' <= data_update
AND count(total) = 0;
Error message:
ERROR: column "total" does not exist LINE 2: ... INTERVAL '17888 SECONDS' <= data_update AND Count(total) = 0 ^
********** Error **********
ERROR: column "total" does not exist SQL state: 42703 Character: 198
someone can help me?
Managed to correct the error with the answer?
– Marco Souza
@GOKUSSJ4 not yet brother!
– Rubens Ventura
Rubens, you could post the tables
corridas
andmotoqueiros
with sample data and what you expect as a result of that query?– Anthony Accioly